Closed TheAwiteb closed 2 years ago
I mean this
I think this could be added to the API. We could allow users to specify a function that returns a response body for the rejected response. This could then be a custom JSON, XML, HTML or whatever you want. We could also add a standard JSON function to make it a bit easier to use.
Ok i'll worked on. Can you review the headers #18, I'm done with it
The TooManyRequests error is returned as a text, which is not good for middleware in the API. Is it better to add a feature called json_response or make it a method like with_headers?