Why do we set status response?
In many tutorials, i Have seen the code below :开发者_如何学Python
response.setStatus( ...);
What is the purpose of this?
Assuming that response
refers to an HTTP response, the setStatus()
method is used to let the user-agent know whether the result of the HTTP request is OK, or if there was some kind of Error.
精彩评论