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 the  method: 'received'  or not 'charset = utf-8', 'authorization': 'OAuth' + ironToken} Inside  Parse.Cloud.httpRequest () . This works, even if I send some data as  body:  (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

after
  body: {'Id': ['someMessageId']}  

is not a valid json object, you need double quotes everywhere:

  "body": {"Id": ["someMessageId"]}  

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -