HTTP 302 Found vs 415 Unsupported Media Type
HTTP 302 (Found) is a 3xx Redirection response, while 415 (Unsupported Media Type) is a 4xx Client Error response. 302 indicates that the resource temporarily resides at a different URL. The client should continue using the original URL for future requests. In contrast, 415 means that the server refuses to accept the request because the Content-Type is not supported.
Description
The resource temporarily resides at a different URL. The client should continue using the original URL for future requests.
When You See It
During A/B testing, temporary maintenance pages, or geo-based redirects.
How to Fix
Follow the Location header. Note: browsers may change POST to GET on redirect.
Description
The server refuses to accept the request because the Content-Type is not supported.
When You See It
When sending JSON to an endpoint that only accepts XML, or missing the Content-Type header.
How to Fix
Set the correct Content-Type header matching the data format you're sending.
Key Differences
302 is a 3xx Redirection response, while 415 is a 4xx Client Error response.
HTTP 302: The resource temporarily resides at a different URL. The client should continue using the original URL for future requests.
HTTP 415: The server refuses to accept the request because the Content-Type is not supported.
You encounter 302 when during A/B testing, temporary maintenance pages, or geo-based redirects.
You encounter 415 when when sending JSON to an endpoint that only accepts XML, or missing the Content-Type header.
When to Use Which
For 302 (Found): Follow the Location header. Note: browsers may change POST to GET on redirect. For 415 (Unsupported Media Type): Set the correct Content-Type header matching the data format you're sending.