put-example tagged requests and articles

Categorized request examples and articles tagged with [put-example] keyword
How to send a PUT request?
To send a PUT request{{ with LANG}}, use the HTTP PUT method and provide the data in the body of the PUT message. The HTTP PUT request method creates a new resource or replaces an existing resource on the server. The Content-Type request header specifies the data type in the body of the PUT request message, and the Content-Length request header specifies the data size in the PUT request body. In contrast to a PATCH request, which partially replaces a resource on the server and can contain only partial data, a PUT request completely overwrites the resource and must have a complete copy of the data. In this {{LANG}} PUT Request Example, we send JSON to the ReqBin echo URL. Click Send to execute {{LANG}} PUT request online and see the results.

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.

What is the HTTP PUT request method and how to use it?
The HTTP PUT method is used to update or replace an existing resource on the server, while the POST method is used to add a resource on the server. When you make an HTTP PUT request, and the Request-URI points to an existing resource, the server MUST completely replace that resource with the data enclosed in the body of the {{LANG}} PUT request. If the Request-URI does not point to an existing resource, the origin server MAY add a new resource with that URI. To partially replace an existing resource, use the HTTP PATCH request method. In this {{LANG}} HTTP PUT Request Example, we send an HTTP PUT request to the ReqBin echo URL. Click Send to make the PUT request online and see the result.

How to put JSON data on the Server?
To put JSON data to the server, you need to make an HTTP PUT request to the server, specify the correct MIME data type for the JSON, and provide the JSON data in the body of the PUT message. The correct MIME type for JSON is application/json. In this PUT JSON to the Server example, we are making an HTTP PUT request to the ReqBin echo URL. The Content-Type: application/json request header specifies the media type for JSON in the body of the HTTP PUT message, and the Accept: application/json request header tells the server that the client is expecting JSON in the server's response. Click Send to execute the PUT JSON request example online and see the results.