What Is a 203 Status Code?
The request was successful but the enclosed payload has been modified from that of the origin server’s 200 OK response by a transforming proxy1.
This status code allows the proxy to notify recipients when a transformation has been applied, since that knowledge might impact later decisions regarding the content. For example, future cache validation requests for the content might only be applicable along the same request path (through the same proxies).
The 203 response is similar to the Warning code of 214 Transformation Applied2, which has the advantage of being applicable to responses with any status code.
A 203 response is cacheable by default; i.e., unless otherwise indicated by the method definition or explicit cache controls3.
- 1 Transformations RFC7230 Section 5.7.2
- 2 Warning RFC7234 Section 5.5
- 3 Calculating Heuristic Freshness RFC7234 Section 4.2.2
- Source: RFC7231 Section 6.3.4
203 CODE REFERENCES
Rails HTTP Status Symbol :non_authoritative_information
Go HTTP Status Constant http.StatusNonAuthoritativeInfo
Symfony HTTP Status Constant Response::HTTP_NON_AUTHORITATIVE_INFORMATION
Python2 HTTP Status Constant httplib.NON_AUTHORITATIVE_INFORMATION
Python3+ HTTP Status Constant http.client.NON_AUTHORITATIVE_INFORMATION
Python3.5+ HTTP Status Constant http.HTTPStatus.NON_AUTHORITATIVE_INFORMATION
.NET HttpStatusCode.NonAuthoritativeInformation
Rust http::StatusCode::NON_AUTHORITATIVE_INFORMATION
Java java.net.HttpURLConnection.HTTP_NOT_AUTHORITATIVE
Apache HttpComponents Core org.apache.hc.core5.http.HttpStatus.SC_NON_AUTHORITATIVE_INFORMATION
Angular @angular/common/http/HttpStatusCode.NonAuthoritativeInformation
What is the difference between a 200 status code and a 203 status code?
The 200 status code indicates that a request has succeeded, while the 203 status code indicates that the request has been successfully processed, but the returned information may be from a source other than the origin server, and therefore may be incomplete or different from what the client expected.
203 status code example
Here is an example of a request and response that could result in a 203 status code:
Request
GET /api/data HTTP/1.1
Host: example.com
Accept: application/json
In this example, the client is sending a GET request to the server to retrieve some data from an API. The client is indicating that it expects to receive JSON data by setting the Accept header to application/json
.
Response
HTTP/1.1 203 Non-Authoritative Information
Date: Tue, 15 Mar 2023 10:30:00 GMT
Content-Type: application/json
Warning: 199 example.com "Representation may be different from what the client expects"
{
"data": {
"id": 123,
"name": "John Doe",
"email": "[email protected]"
},
"meta": {
"source": "cache"
}
}
In this example, the server is responding with a 203 status code indicating that the returned representation may be different from what the client expects. The server is also including a warning header indicating that the representation may be different.
In the response body, the server is returning JSON data with some metadata indicating that the data was retrieved from a cache rather than directly from the origin server. This is an example of a scenario where a 203 status code could be used to indicate that the returned representation is different from what the client expected.
What causes a 203 status code?
A 203 status code is typically returned by a server in response to a GET or HEAD request when the server is returning a representation of the resource that is different from the one the client has requested. This may occur for several reasons, including:
- Caching: The server may be returning a cached version of the resource that is different from the current version on the origin server. This can happen if the server has not yet received an updated version of the resource from the origin server.
- Negotiation: The server may be returning a different representation of the resource based on content negotiation. This can happen if the client has requested a specific media type or language, and the server is returning a different media type or language that is available.
- Modified resource: The server may be returning a different representation of the resource because the resource has been modified since the client last accessed it. In this case, the server may return a 203 status code with a warning header indicating that the representation may be different from what the client expects.
In all cases, the server is indicating that the returned representation of the resource may not be exactly what the client was expecting, but it is still providing a valid response.
How to troubleshoot a 203 status code
If you encounter a 203 status code in response to an HTTP request, it indicates that the server has successfully processed the request and has returned a response from a cache or proxy server rather than the original source of the information. This is usually not an error condition, but rather an expected behavior in certain situations.
However, if you are experiencing issues with the response, there are a few troubleshooting steps you can take:
- Check the headers: Look for headers that indicate the cache or proxy server that provided the response, such as “Via” or “X-Cache”. These headers may provide information on why the server chose to use the cached response.
- Check the response content: Make sure that the response content matches what you were expecting. If the response is stale or outdated, you may need to send a new request with appropriate headers to indicate that you want a fresh copy of the resource.
- Check for network issues: If you are consistently receiving 203 responses, you may be experiencing network issues that are preventing you from accessing the original source of the information. Check your network settings and connectivity to ensure that you can reach the server hosting the original content.
- Check for server issues: The server providing the cached response may be experiencing issues that are preventing it from accessing the original source of the information. Check with the server administrator to see if there are any known issues or maintenance activities that may be affecting the service.
Overall, a 203 status code is not an error condition, but rather an informational status code indicating that the response is not from the original source. If you are experiencing issues with the response, it may be necessary to investigate further to determine the cause of the problem.
Additional resources
- Learn about web development
- Learn about SEO
- Web development services from WebFX
- SEO services from WebFX
- MDN Web Docs
- W3Schools
Marketing Tips for Niche Industries
- Tourism & Hospitality Statistics
- Travel and Tourism Marketing Budget
- Urgent Care Marketing Ideas: 5 High-ROI Tactics
- WebFX: Your Education Digital Marketing Agency
- Why Auto Part Retailers Need Digital Marketing
- Why Digital Marketing is Essential for Auctioneers
- Your Guide to Digital Marketing for Exercise Equipment Companies
- Your Guide to Digital Marketing for Industrial Repair Companies
- Vision Care Industry Statistics
- 6 Best Heavy Equipment Marketing Agencies