class documentation
class HttpResponseBase: (source)
Known subclasses: django.http.HttpResponse
, django.http.StreamingHttpResponse
An HTTP response base class with dictionary-accessed headers. This class doesn't handle content. It should not be used directly. Use the HttpResponse and StreamingHttpResponse subclasses instead.
Method | __delitem__ |
Undocumented |
Method | __getitem__ |
Undocumented |
Method | __init__ |
Undocumented |
Method | __setitem__ |
Undocumented |
Method | charset |
Undocumented |
Method | close |
Undocumented |
Method | delete |
Undocumented |
Method | flush |
Undocumented |
Method | get |
Undocumented |
Method | has |
Case-insensitive check for a header. |
Method | items |
Undocumented |
Method | make |
Turn a value into a bytestring encoded in the output charset. |
Method | readable |
Undocumented |
Method | reason |
Undocumented |
Method | seekable |
Undocumented |
Method | serialize |
HTTP headers as a bytestring. |
Method | set |
Set a cookie. |
Method | set |
Undocumented |
Method | setdefault |
Set a header unless it has already been set. |
Method | tell |
Undocumented |
Method | writable |
Undocumented |
Method | write |
Undocumented |
Method | writelines |
Undocumented |
Instance Variable | closed |
Undocumented |
Instance Variable | cookies |
Undocumented |
Instance Variable | headers |
Undocumented |
Instance Variable | status |
Undocumented |
Property | charset |
Undocumented |
Property | reason |
Undocumented |
Instance Variable | _charset |
Undocumented |
Instance Variable | _handler |
Undocumented |
Instance Variable | _reason |
Undocumented |
Instance Variable | _resource |
Undocumented |
Property | _content |
Undocumented |
def __init__(self, content_type=None, status=None, reason=None, charset=None, headers=None):
(source)
¶
overridden in
django.http.HttpResponse
, django.http.StreamingHttpResponse
Undocumented
def set_cookie(self, key, value='', max_age=None, expires=None, path='/', domain=None, secure=False, httponly=False, samesite=None):
(source)
¶
Set a cookie. ``expires`` can be: - a string in the correct format, - a naive ``datetime.datetime`` object in UTC, - an aware ``datetime.datetime`` object in any time zone. If it is a ``datetime.datetime`` object then calculate ``max_age``. ``max_age`` can be: - int/float specifying seconds, - ``datetime.timedelta`` object.
overridden in
django.http.HttpResponseBadRequest
, django.http.HttpResponseForbidden
, django.http.HttpResponseGone
, django.http.HttpResponseNotAllowed
, django.http.HttpResponseNotFound
, django.http.HttpResponseNotModified
, django.http.HttpResponsePermanentRedirect
, django.http.HttpResponseRedirect
, django.http.HttpResponseServerError
Undocumented