curl command data transmission JSON

curl -H "Content-Type: application/json" -X POST -d "{\"abc\":123}" "https://httpbin.org/post"

windows, data -d parameter, you need to use double quotes, json in double quotation marks can use the backslash escape

-X: http request of the specified method. If the -d, the default is to use the POST, -X parameters can be omitted.

json data in one file

curl -H "Content-Type: application/json" -X POST -d @test.json URL

Guess you like

Origin www.cnblogs.com/erinchen/p/11359637.html