简体   繁体   中英

Apiary.io invalid JSON Body

Here is my invalid JSON Body Error on Apiary.io? What went wrong?

My Request is like that:

var body = {
  //JSON stuff..
};

$.ajax({
  url : 'URL',
  type : 'POST',
  data : body,
  async: false,
  dataType : 'json',
  success : function (data) {
    body['sessionid'] = data['sessionid'];
    SetSessionID(data['sessionid']);
    console.log(data);
  }   
});  

It looks like your JSON request is invalid and is urlencoded instead of JSON-encoded.

If that wouldn't help, it would help to post the actual data that went over the wire (in case of bug on Apiary side), and the relevant blueprint snippet for the given endpoint.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM