服务器无法解析有效的json

我正在向url发出这个ajax请求,但是服务器正在发送响应Unrecognized token 'naejzraieale': was expecting 'null', 'true', 'false' or NaN at [Source: org.eclipse.jetty.server.HttpInput@13367e3; line: 1, column: 25] Unrecognized token 'naejzraieale': was expecting 'null', 'true', 'false' or NaN at [Source: org.eclipse.jetty.server.HttpInput@13367e3; line: 1, column: 25]

我的Ajax请求看起来像这样

 $.ajax({url: "https://jsonparser.mydomain.com", contentType: 'application/json', type: "POST", data :{name : "juzer ali", email : "er.juzerali@gmail.com", how : "Used jQuery.ajax from google chromes developer console", urls : ["https://chrome.google.com/webstore/search/passportpro", "https://chrome.google.com/webstore/detail/ffimgldnoigmlcofmfkfcjechbdkipph", "https://github.com/juzerali", "https://docs.google.com/document/d/1BXOwXojdKwghZ3nvnfPeleEgjv0whJVWVXtQMwcXLiA/edit?pli=1", "authagentpro.appspot.com"]} }); 

编辑:请注意Unrecognized token 'naejzraieale': 此错误字符串中的jr来自我传入数据的对象的name属性。 当我把这些字母大写时,我得到(Unrecognized token 'naeJZRAIeale': was expecting 'null', 'true',)

在将数据发送到服务器之前,您需要以JSON格式对其进行编码JSON.stringify和JSON.parse由最新的浏览器提供,但如果任何浏览器不支持,那么您可以使用jquery插件来执行相同的http://代码.google.com / p / jquery-json / ,如果你使用这个插件,那么语法会有所不同

 $.ajax({ url: "https://jsonparser.mydomain.com", type: 'POST', contentType:'application/json', data: JSON.stringify({name : "juzer ali", email : "er.juzerali@gmail.com", how : "Used jQuery.ajax from google chromes developer console", urls : ["https://chrome.google.com/webstore/search/passportpro", "https://chrome.google.com/webstore/detail/ffimgldnoigmlcofmfkfcjechbdkipph", "https://github.com/juzerali", "https://docs.google.com/document/d/1BXOwXojdKwghZ3nvnfPeleEgjv0whJVWVXtQMwcXLiA/edit?pli=1", "authagentpro.appspot.com"]}), dataType:'json' });