In order to send JSON data as payload with an HTTP Post cURL request you need to add,
1. The JSON Header for Content-type
-H "Content-Type: application/json"
2. Include the JSON data payload using --data flag
--data '{"city":"USA","state":"New York"}'
Complete Example
curl -X POST \
-H "Content-Type: application/json" \
--data '{"city":"USA","state":"New York"}' \
http://example.com/api/endpoint

Provide Feedback For This Article
We take your feedback seriously and use it to improve our content. Thank you for helping us serve you better!
😊 Thanks for your time, your feedback has been registered!
Comments & Discussion
Facing issues? Have questions? Post them here! We're happy to help!