samedi 24 janvier 2015

Problems making REST POST requests to SP-Hosted App with Postman

I am facing problems when making REST calls of type POST to my Sharepoint Hosted app with Postman in Chrome. GET type calls work fine.


For example, I want to make the following call on my app to get the changes on a list (and yes, this is a POST call weird enough):



http://ift.tt/1zHpSoe


Response is the following:



{
"error": {
"code": "-2130575251, Microsoft.SharePoint.SPException",
"message": {
"lang": "en-US",
"value": "The security validation for this page is invalid and might be corrupted. Please use your web browser's Back button to try your operation again."
}
}


Googling learned me that I have to add a X-RequestDigest header with the value obtained from the POST call:


../_api/contextinfo


Indeed I get a value there as expected but when I add it to the headers, it still does not work. Am I missing something here? Really need this to work!!!!


Aucun commentaire:

Enregistrer un commentaire