POST JSON data with cURL

Sends a POST request with JSON data using curl by setting the content-type of the request to "application/json".

Authored by: Sean Patrick Floyd
Brought to you by Warp, a free terminal reimagined to work like a modern app.
json_data
url

Command
Copy
curl --header "Content-Type: application/json" \ --request POST \ --data 'json_data' \ url
Tags