curl-put tagged requests and articles

Categorized request examples and articles tagged with [curl-put] keyword
How to send PUT request using Curl?
You can use the -X PUT command-line option to make an HTTP PUT request with Curl. PUT request data is passed with the -d command-line parameter. If you give -d and omit -X, Curl will automatically choose the HTTP POST method. The -X PUT option explicitly tells Curl to select the HTTP PUT method instead of POST. The data type for the Curl request is set using the -H command-line option. In this Curl PUT Example, we send a request to the ReqBin echo URL. Click Run to execute the Curl PUT request online and see the results.

How do I set the content type for a Curl request?
To send the Content-Type header using Curl, you need to use the -H command-line option. For example, you can use the -H "Content-Type: application/json" command-line parameter for JSON data. Data is passed to Curl using the -d command-line option. It must match the provided content type. In this Curl Content-Type example, we are sending JSON to the ReqBin echo URL. Click Run to execute the Curl Content-Type example online and see the results.