If-Match Header
Table of Content
- Syntax
- Directives
- Examples
- Browser Compatibility
- How to modify If-Match header The If-Match HTTP request header is used by the server to ensure that the requested operation can be applied reliably. Precisely, to avoid conflicts while updating a resource, the If-Match header is paired up with the ETag header. If the client's entity tag doesn't match with the server's entity tag, the server refuses to perform the operation. This can prove effective in avoiding complications in situations where multiple client changes occur simultaneously.
Syntax
If-Match: <etag_value>
If-Match: *
Directives
<etag_value>
: A specific ETag value, which is an identifier for a specific version of a resource.*
: The asterisk represents any ETag value. Using it means the action will be performed irrespective of the current ETag value.
Examples
To ensure an operation based on an ETag value:
If-Match: "bfc13a64729c4290ef5b2c2730249c88ca92d82d"
To perform an operation regardless of the ETag value:
If-Match: *
Browser Compatibility
Browser | Compatibility |
---|---|
Chrome | Supported |
Firefox | Supported |
Safari | Supported |
Opera | Supported |
Edge | Supported |
How to modify If-Match header
ModHeader is a Chrome extension that allows you to customize request headers. You can use it to modify the If-Match header by following these steps:
- Install ModHeader from the Chrome Web Store.
- Click on the ModHeader icon in the toolbar.
- Click on 'Add' to add a new header, enter 'If-Match' in the 'name' field and input your desired ETag value in the 'value' field.
Modifying the If-Match header can be useful for testing how your server handles requests with different If-Match headers, ensuring your server response is appropriate and the functionality is accurate. It plays an essential role in error checking and troubleshooting.