win10实测,此处 json 需要转义,否则会出现Exception,无法正确解析:
JsonParseException: Unexpected character (''' (code 39)): was expecting double-quote to start field name
正确转义如下:
curl -v -H "Content-Type:application/json" -d ***"{\"email\":\"bob@example.com\"}"*** [http://localhost:8080/rest](http://localhost:8080/rest)
*** 是啥玩意???是不是网页排版格式问题?请自删星号!
JSON里面到处都是引号,所以-d要用单引号:
-d ' xxxx '
Sign in to make a reply
心有灵犀的小欣
win10实测,此处 json 需要转义,否则会出现Exception,无法正确解析:
正确转义如下:
curl -v -H "Content-Type:application/json" -d ***"{\"email\":\"bob@example.com\"}"*** [http://localhost:8080/rest](http://localhost:8080/rest)