HTTP PATCH Method

The HTTP PATCH method is used to make partial changes to an existing resource. Typically, the PATCH method applies partial modifications to a resource, while the PUT method performs a complete replacement of the resource. Unlike GET and HEAD requests, the PATCH requests may change the server state.

You can send data to the server in the body of the HTTP PATCH message. The type and size of data are not limited. But you must specify the data type in the Content-Type header and the data size in the Content-Length header fields. You can also send data to the server using URL parameters. In this case, you are limited to the maximum size of the URL, which is about 2000 characters (depends on the browser).

The PATCH method is not idempotent, which means that sending an identical PATCH request multiple times may additionally affect the state or cause further side effects.

The following example demonstrates sending a PATCH request to the server:

PATCH Request Example Live Request
PATCH /echo/patch/json HTTP/1.1
Authorization: Bearer mt0dgHmLJMVQhvjpNXDyA83vA_PxH23Y
Accept: application/json
Content-Type: application/json
Content-Length: 85
Host: reqbin.com

{
  "Id": 12345,
  "Customer": "John Smith",
  "Quantity": 1,
  "Price": 10.00
}

And the server response:

Server Response
HTTP/1.1 200 OK
Content-Length: 19
Content-Type: application/json

{"success":"true"}


To read more about HTTP PATCH method please check RFC2616.