Forum

Thread tagged as: Question, Runway

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!

Ryan Gittings

Ryan Gittings 1 points

  • 2 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

I'm not sure I follow. Are you not getting a 404 when you expect one?

Ryan Gittings

Ryan Gittings 1 points
Registered Developer

I do get a 404, the main site 404. It’d be nice to have a separate one for the API, that’s all.

Drew McLellan

Drew McLellan 2638 points
Perch Support

What more do you need than the status code when using the API?

Ryan Gittings

Ryan Gittings 1 points
Registered Developer

It'd be nice to return JSON to keep the format consistent. Not a necessity, but nice to have.

Drew McLellan

Drew McLellan 2638 points
Perch Support

You should be reading the HTTP status code before processing the body of the response.