Am Fr., 11. Jan. 2019 um 05:57 Uhr schrieb Mike Orr :
> Is there a simple way to convert a Response to an HTTP string; i.e.,
> with headers and a body like it would send to the client?
>
> I have a JSON backend view that sends an HTTP exception like this:
>
> # HTTP 422, simulating a validation er
Your frontend that's making the ajax call is likely not configuring the
accept header appropriately to prefer application/json content.
On Thu, Jan 10, 2019 at 10:57 PM Mike Orr wrote:
> Is there a simple way to convert a Response to an HTTP string; i.e.,
> with headers and a body like it would
Is there a simple way to convert a Response to an HTTP string; i.e.,
with headers and a body like it would send to the client?
I have a JSON backend view that sends an HTTP exception like this:
# HTTP 422, simulating a validation error
jreq = {"email": "m...@example.com", "errors": {"email": "Tes