简体   繁体   English

Apiary.io无效的JSON正文

[英]Apiary.io invalid JSON Body

Here is my invalid JSON Body Error on Apiary.io? 是我在Apiary.io上无效的JSON正文错误? 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. 看起来您的JSON请求无效,并且使用urlencode编码,而不是JSON编码。

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. 如果这样做没有帮助,则将有助于发布通过网络的实际数据(以防止在Apiary侧发生错误),并发布给定端点的相关蓝图片段。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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