码迷,mamicode.com
首页 > Web开发 > 详细

post 的body json要使用双引号,而不是单引号

时间:2015-05-15 13:29:49      阅读:249      评论:0      收藏:0      [点我收藏+]

标签:

 
string parse error , JS eval error
{
‘name‘ : ‘wade‘ 
}
 
http://json.parser.online.fr/

技术分享

string parse ok , JS eval ok
{
"name" : "wade" 
}
 

技术分享

info: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.152 Safari/537.36" "referer:" "127.0.0.1 POST /user/a HTTP/1.1 200" response size : -1 need time 0ms.

/user/a  post req.body {}

error: Unable to parse HTTP body- error occurred :: { [SyntaxError: Unexpected token ‘] body: ‘{\n  \‘name\‘ : \‘wade\‘ \n}‘, status: 400 }

info: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.152 Safari/537.36" "referer:" "127.0.0.1 POST /user/a HTTP/1.1 200" response size : -1 need time 0ms.

/user/a  post req.body {}

bbbb { name: ‘wade‘ }

post 的body json要使用双引号,而不是单引号

标签:

原文地址:http://www.cnblogs.com/no7dw/p/4505655.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!