Accept-Patch Header

Table of Content

The Accept-Patch response HTTP header is used to specify which patch document formats are accepted by the server while processing a resource. In simpler terms, it communicates the type(s) of data that the client may use for sending partial updates to a specified resource on the server. Accept-Patch, together with PATCH, provides HTTP functionalities that can be likened to the commit/update mechanism found in many version control systems.

Syntax

Accept-Patch: <media-type>

Where <media-type> is a valid media type, such as application/json.

Directives

The only directive of the Accept-Patch header is the <media-type> which is a string indicating the media type. The media type is often specified by listing the MIME types which the server is ready to understand.

Examples

The below example demonstrates an Accept-Patch header specifying that the server accepts patches in JSON format:

Accept-Patch: application/json

Browser Compatibility

Browser Compatibility
Chrome Not Supported
Firefox Not Supported
Safari Not Supported
Opera Not Supported
Edge Not Supported

Accept-Patch is a standard response header defined in RFC 5789, but it is not directly supported by most browsers since it communicates between the client and the server at the application-level of HTTP communication.

How to modify Accept-Patch header

ModHeader is a powerful Chrome extension that can be used to modify HTTP headers. It provides an intuitive UI that enables easy addition, deletion, and temporary disablement of any HTTP header for active tabs.

To use ModHeader to modify the Accept-Patch header:

  1. Install the ModHeader extension from the Chrome Web Store.
  2. Open the extension by clicking on its icon next to the address bar.
  3. In the 'Response Headers' section, click on 'Add' and input 'Accept-Patch' in the 'name' field.
  4. In the 'value' field, input the desired media-type, for instance 'application/json'.
  5. Browse as usual; the modification will apply to all sites accessed in the tabs where the extension is enabled.

Please note this modification is most likely beneficial for development, debugging and testing purposes as browsers don't handle Accept-Patch directly.