http.HttpResponseRedirect

class HttpResponseRedirect [source] The first argument to the constructor is required – the path to redirect to. This can be a fully qualified URL (e.g. 'https://www.yahoo.com/search/'), an absolute path with no domain (e.g. '/search/'), or even a relative path (e.g. 'search/'). In that last case, the client browser will reconstruct the full URL itself according to the current path. See HttpResponse for other optional constructor arguments. Note that this returns an HTTP status code 302. ur

http.HttpResponsePermanentRedirect

class HttpResponsePermanentRedirect [source] Like HttpResponseRedirect, but it returns a permanent redirect (HTTP status code 301) instead of a “found” redirect (status code 302).

http.HttpResponseNotModified

class HttpResponseNotModified [source] The constructor doesn’t take any arguments and no content should be added to this response. Use this to designate that a page hasn’t been modified since the user’s last request (status code 304).

http.HttpResponseNotFound

class HttpResponseNotFound [source] Acts just like HttpResponse but uses a 404 status code.

http.HttpResponseNotAllowed

class HttpResponseNotAllowed [source] Like HttpResponse, but uses a 405 status code. The first argument to the constructor is required: a list of permitted methods (e.g. ['GET', 'POST']).

http.HttpResponseGone

class HttpResponseGone [source] Acts just like HttpResponse but uses a 410 status code.

http.HttpResponseForbidden

class HttpResponseForbidden [source] Acts just like HttpResponse but uses a 403 status code.

http.HttpResponseBadRequest

class HttpResponseBadRequest [source] Acts just like HttpResponse but uses a 400 status code.

http.HttpResponse.__setitem__()

HttpResponse.__setitem__(header, value) Sets the given header name to the given value. Both header and value should be strings.

http.HttpResponse.__init__()

HttpResponse.__init__(content='', content_type=None, status=200, reason=None, charset=None) [source] Instantiates an HttpResponse object with the given page content and content type. content should be an iterator or a string. If it’s an iterator, it should return strings, and those strings will be joined together to form the content of the response. If it is not an iterator or a string, it will be converted to a string when accessed. content_type is the MIME type optionally completed by a ch