Client Error (4xx)
HTTP 406 — 406 Not Acceptable
The target resource does not have a current representation that would be acceptable to the user agent according to the proactive negotiation headers (Accept, Accept-Charset, Accept-Encoding, Accept-Language).
Common Causes & Diagnoses
- •Client requested format not produced by server (e.g. Accept: application/xml when API only serves application/json).
Spesifikasyon & Kategori
Status Code:406
Category:Client Error (4xx)
RFC Standard:RFC 9110 / HTTP/1.1 & HTTP/2
Multi-Language Code Implementations
How to Handle, Return & Test HTTP 406
Status: 406 406 Not Acceptable
server.js / handler.ts
// Express.js Server Response
app.get('/api/resource', (req, res) => {
// Returning 406 406 Not Acceptable
return res.status(406).json({
error: '406 Not Acceptable',
statusCode: 406,
timestamp: new Date().toISOString()
});
});
// Client-side fetch error check
const response = await fetch('/api/resource');
if (response.status === 406) {
console.warn('Received HTTP 406 406 Not Acceptable');
}💡 Pro Tip: Ensure appropriate error handling middleware or proxy interceptors are enabled so client applications receive structured JSON responses for HTTP 406.
How to Fix / Practical Code Solutions
Check Accept Headers
Ensure client Accept header matches server supported MIME types.
curl -H "Accept: application/json" https://api.example.com/data
Other Popular HTTP Status Codes
Frequently Asked Questions
Common Questions About HTTP 406 to RFC Standard
Everything you need to know regarding specifications, syntax, and security best practices.
The target resource does not have a current representation that would be acceptable to the user agent according to the proactive negotiation headers (Accept, Accept-Charset, Accept-Encoding, Accept-Language). In Turkish: Sunucu, istemcinin Accept başlığında talep ettiği içerik türünü (MIME type) üretemiyor.