http.JsonResponse

class JsonResponse(data, encoder=DjangoJSONEncoder, safe=True, json_dumps_params=None, **kwargs) [source] An HttpResponse subclass that helps to create a JSON-encoded response. It inherits most behavior from its superclass with a couple differences: Its default Content-Type header is set to application/json. The first parameter, data, should be a dict instance. If the safe parameter is set to False (see below) it can be any JSON-serializable object. The encoder, which defaults to django.core

http.HttpResponseGone

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

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.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

http.HttpResponseBadRequest

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

http.HttpResponse.__delitem__()

HttpResponse.__delitem__(header) Deletes the header with the given name. Fails silently if the header doesn’t exist. Case-insensitive.

http.HttpResponse.__setitem__()

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