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

 
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‘ }

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。