On http status and http response using Xano

I am trying to build state of the art APIs using Xano, following REST principles.
As such, when creating a resource, I want to return a 201.

Following the documentation at https://docs.xano.com/the-function-stack/functions/utility-functions#custom-http-status, I implemented the set header.

I expected two things : the client creating a resource and making the API call to get a 201 (which it does) and the associated log status to match and be 201. This second point does not work (never has, I believe).

See screenshots below :



Bug or feature request ? I believe it's a bug, because even though it has never worked, it makes very little sense to have a 200 status in the logs if it is not what was actually sent back.

Same error occurs when wanting to return a custom error with a 400 status code. The status in the logs remains 200. This is probably even more disturbing as it makes the metadata-api request history API filter on status worthless : instead of returning all 400 errors my clients got, it returns only the ones sent using preconditions.
The only option available to have matching custom status in the logs is probably to use precondition but this implies following up the format Xano decides to use for their errors and restricting yourself to a handful of statuses.

I could suggest a few things :

  • fix the log status of request returning a header HTTP/1.1 XXX to XXX

  • implement a function to return/throw a custom HTTP status, with full list or discretionary value, allowing to specify a fully customizable payload, which woud have effect on the log status

I could also use a state of the art proxy in front of Xano and perform my customizing and monitoring on this brick, but I believe this defies the purpose of Xano as an API platform.

Similar subjects are numerous :

1
5 replies