Failed to decode JSON in HTTP request -
I'm using to make a 'DELETE' HTTP request.
This is exactly the same as the header and the request URL for 'get in' header:
header: {'content-type': 'application / json; The 'received' request works, whether I put themethod: 'received'
or not 'charset = utf-8', 'authorization': 'OAuth' + ironToken} InsideParse.Cloud.httpRequest ()
. This works, even if I send some data asbody:
(which is ignored).However, for the 'DELETE' request, I have to send body:
body: {'id': ['someMessageId']}
>{"status": "content-length": "32", "content-type": "400", " Header ": {" Access-Control-Permission-Origin ":" * "," Connection ":" Keep-alive "," Content-Length ":" Application / Jason "," Date ":" Tuesday, May 06, 2014 10:15:27 GMT "}," text ":" {\ "msg \": \ "Failed to decode JSON {"Msg": "Failed to decode JSON."}, "Buffer": [...], "cookies": {}}Any idea why this happens and what else can I do? Test
body: {'Id': ['someMessageId']}
is not a valid json object, you need double quotes everywhere:
"body": {"Id": ["someMessageId"]}
Comments
Post a Comment