In this post I would like to show how to make post request with JSON
data using curl
cli tool.
Inline JSON
1curl -X POST \2-H "Content-Type: application/json" \3-H "Accept: application/json" \4-d '{"username":"xyz","password":"xyz"}' \5https://httpstat.us/200
JSON file
1curl -X POST \2-H "Content-Type: application/json" \3-H "Accept: application/json" \4-d @auth.json \5https://httpstat.us/200