Forum
Headless API 404
Hi,
Is there a way to add a custom 404 to the /api
section for headless requests? It'd be good to specify a 404 just for headless requests.
Cheers!
Hi,
Is there a way to add a custom 404 to the /api
section for headless requests? It'd be good to specify a 404 just for headless requests.
Cheers!
I'm not sure I follow. Are you not getting a 404 when you expect one?
I do get a 404, the main site 404. It’d be nice to have a separate one for the API, that’s all.
What more do you need than the status code when using the API?
It'd be nice to return JSON to keep the format consistent. Not a necessity, but nice to have.
You should be reading the HTTP status code before processing the body of the response.