Windows 10 x64 using CURL tool simulates the difference between the POST request with Lunix

Lunix Shell:    curl -H "Content-Type:application/json" -H "Accept:application/json" -X POST -d '{"name":"zhangsan"}' -v http://localhost:8080/demo

Windows cmd:  curl -H "Content-Type:application/json" -H "Accept:application/json" -X POST -d "{\"name\":\"zhangsan\"}" -v http://localhost:8080/demo

 

Parameter Description:

-H setting request header

-X type setting request (POST, GET, PUT, DELETE, PATCH, etc)

-d / - data: Parameter POST request

Specific information returned in response to a request -v

Difference: when passing parameters Window cmd only recognizes double quotes ( ") are not supported Lunix of single and double quotation marks mix, so the windows need to be escaped using a curl of the parameter string of double quotes.

Guess you like

Origin www.cnblogs.com/FallenPuppet/p/11306699.html