🎉 Requestly joins BrowserStack to build the future of application testing. Read more

HTTP Headers

Warning

HTTP Header

Deprecated: This feature is no longer recommended. Although some browsers may still support it, it might have already been removed from current web standards, is in the process of being deprecated, or is maintained solely for compatibility reasons. It is advisable to avoid using this feature and to update any existing code accordingly. Refer to the compatibility table at the bottom of this page for guidance. Please note that this feature could cease to function at any time.

 

Note:
The header was deprecated because it is not widely generated or presented to users (see RFC9111).
Some of the information previously conveyed by this header can now be inferred from other headers, such as Age.

 

The HTTP Warning request and response headers provide information regarding potential issues with the message status.
Multiple Warning headers may appear in a single response.

 

Warning header fields can generally be applied to any message.
However, some warning codes are specific to caches and can only be used with response messages.

 

Header typeRequest header,
Response header
Forbidden request headerNo

Syntax

Warning: <warn-code> <warn-agent> <warn-text> [ <warn-date> ]

Directives

Directives

<warn-code>
A three-digit warning number. The first digit indicates whether the Warning is required to be deleted from a stored response after validation.

    • 1xx warn-codes describe the freshness or validation status of the response and will be deleted by a cache after successful validation.
    • 2xx warn-codes describe some aspect of the representation that is not rectified by a validation and will not be deleted by a cache after validation unless a full response is sent.
<warn-agent>
The name or pseudonym of the server or software adding the Warning header (might be “-” when the agent is unknown).
<warn-text>
An advisory text describing the error.
<warn-date> Optional
A date. If more than one Warning header is sent, include a date that matches the Date header.

Example

Warning codes

The HTTP Warn Codes registry at iana.org defines the namespace for warning codes.

 

CodeTextDescription
110Response is StaleThe response provided by a cache is stale (the expiration time set for the response has passed).
111Revalidation FailedAn attempt to validate the stale response failed due to an inability to reach the server.
112Disconnected OperationThe cache is intentionally disconnected from the rest of the network.
113Heuristic ExpirationA cache heuristically chose a freshness lifetime greater than 24 hours and the age of the response is greater than 24 hours.
199Miscellaneous WarningArbitrary information that should be presented to a user or logged.
214Transformation AppliedAdded by a proxy if it applies any transformation to the representation, such as changing the content-coding, media-type or the like.
299Miscellaneous Persistent WarningArbitrary information that should be presented to a user or logged. This warn-code is similar to the warn-code 199 and additionally indicates a persistent warning.

The warning codes are essential for diagnosing issues related to caching and response validity. They aid in understanding the state and behavior of caches and proxy servers during HTTP communications.

http
Warning: 110 anderson/1.3.37 "Response is stale"
<br>Date: Wed, 21 Oct 2015 07:28:00 GMT
Warning: 112 - "cache down" "Wed, 21 Oct 2015 07:28:00 GMT"

How to Modify Header using Requestly

Requestly is a powerful Chrome extension that allows you to modify HTTP headers, including the Warning header. This can be helpful for testing how your application handles warnings sent by the server or simulating specific warning scenarios during development. Steps to Modify the Warning Header:

  1. Install and open the Requestly Chrome extension. You can find it on the Chrome Web Store.
  2. Create a new rule: Click on “Create Rule” and choose “Modify Headers” from the list of available rule types.
  3. Add a new header modification:
    • Under “Action”, select “Add” or “Override”.
    • In the “Header Name” field, enter Warning.
    • In the “Header Value” field, enter your desired warning message (e.g., 199 – “Deprecated API”).
  4. Set the URL condition: Specify the URL or pattern where this header change should apply (e.g., https://your-api.com/*).
  5. Save the rule.

Once set up, Requestly will inject the specified Warning header into all matching requests, allowing you to test how your application reacts to different warning messages from the server.