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

posted @ 2015-05-15 12:49  邓维  阅读(1695)  评论(0编辑  收藏  举报