How do I post a body using Curl?

To post data in the body of a request message using Curl, you need to pass the data to Curl using the -d or --data command line switch. The Content-Type header indicates the data type in the body of the request message. This header is required by the server to correctly interpret and process the data in the body of the POST message. For example, if you send JSON to the server, you must specify the data type in the body using the Content-Type: application/json header. Click Run to execute Curl POST body example online and see results.
Loading...