HTTP 403 Forbidden vs 406 Not Acceptable
Both HTTP 403 (Forbidden) and 406 (Not Acceptable) belong to the 4xx Client Error category. 403 indicates that the server understood the request but refuses to authorize it. Unlike 401, authentication will not help — the user simply does not have permission. Meanwhile, 406 means that the server cannot produce a response matching the Accept headers sent by the client.
Description
The server understood the request but refuses to authorize it. Unlike 401, authentication will not help — the user simply does not have permission.
When You See It
When trying to access a resource you're authenticated for but don't have permission to access.
How to Fix
Check your user role/permissions. Contact the admin to request access.
Description
The server cannot produce a response matching the Accept headers sent by the client.
When You See It
When requesting a content type the server doesn't support (e.g., Accept: application/xml when only JSON is available).
How to Fix
Adjust the Accept header to a format the server supports.
Key Differences
HTTP 403: The server understood the request but refuses to authorize it. Unlike 401, authentication will not help — the user simply does not have permission.
HTTP 406: The server cannot produce a response matching the Accept headers sent by the client.
You encounter 403 when when trying to access a resource you're authenticated for but don't have permission to access.
You encounter 406 when when requesting a content type the server doesn't support (e.g., Accept: application/xml when only JSON is available).
When to Use Which
For 403 (Forbidden): Check your user role/permissions. Contact the admin to request access. For 406 (Not Acceptable): Adjust the Accept header to a format the server supports.