Skip to content

406 Not Acceptable

The client requested a specific content type (like XML), but the server can only provide another type (like JSON).

Use this if your API only speaks JSON, but the client sends an ‘Accept: text/xml’ header explicitly refusing to accept JSON.

import { HttpException, get } from 'shokupan';
export const getResource = get('/resource', () => {
throw new HttpException('Not Acceptable', 406);
});