Question

I am probably staring it right in the face here. But does Django have a way of actually checking what the HTTP Status code is. I'm basically interested if it's the 302 redirect status code. But no matter what I try and search for I'm only getting HTTPResponse() which is no good to me.

Était-ce utile?

La solution

Your question unfortunately doesn't make any sense. The reason why you don't get any Google results for this is that there's simply no such thing as a status code for a request. The status code is what the server sends back to the client as a result of the request: it's unavoidably part of the response, not the request.

I suspect however that this is an XY problem. What, exactly, are you trying to achieve? If you need some data to be preserved through a redirect, then you probably want to store it in the session.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top