class documentation

class Request: (source)

View In Hierarchy

Wrapper allowing to enhance a standard `HttpRequest` instance. Kwargs: - request(HttpRequest). The original request instance. - parsers(list/tuple). The parsers to use for parsing the request content. - authenticators(list/tuple). The authenticators used to try authenticating the request's user.

Method __getattr__ If an attribute does not exist on this instance, then we also attempt to proxy it to the underlying HttpRequest object.
Method __init__ Undocumented
Method __repr__ Undocumented
Method auth.setter Sets any non-user authentication information associated with the request, such as an authentication token.
Method force_plaintext_errors Undocumented
Method user.setter Sets the user on the current request. This is necessary to maintain compatibility with django.contrib.auth where the user property is set in the login and logout functions.
Instance Variable auth Returns any non-user authentication information associated with the request, such as an authentication token.
Instance Variable authenticators Undocumented
Instance Variable negotiator Undocumented
Instance Variable parser_context Undocumented
Instance Variable parsers Undocumented
Instance Variable user Returns the user associated with the current request, as authenticated by the authentication classes provided to the request.
Property content_type Undocumented
Property data Undocumented
Property DATA Undocumented
Property FILES Undocumented
Property POST Undocumented
Property query_params More semantically correct name for request.GET.
Property QUERY_PARAMS Undocumented
Property stream Returns an object that may be used to stream the request content.
Property successful_authenticator Return the instance of the authentication instance class that was used to authenticate the request, or `None`.
Method _authenticate Attempt to authenticate the request using each authentication instance in turn.
Method _default_negotiator Undocumented
Method _load_data_and_files Parses the request content into `self.data`.
Method _load_stream Return the content body of the request, as a stream.
Method _not_authenticated Set authenticator, user & authtoken representing an unauthenticated request.
Method _parse Parse the request content, returning a two-tuple of (data, files)
Method _supports_form_parsing Return True if this requests supports parsing form data.
Instance Variable _auth Undocumented
Instance Variable _authenticator Undocumented
Instance Variable _content_type Undocumented
Instance Variable _data Undocumented
Instance Variable _files Undocumented
Instance Variable _full_data Undocumented
Instance Variable _request Undocumented
Instance Variable _stream Undocumented
Instance Variable _user Undocumented
def __getattr__(self, attr): (source)

If an attribute does not exist on this instance, then we also attempt to proxy it to the underlying HttpRequest object.

def __init__(self, request, parsers=None, authenticators=None, negotiator=None, parser_context=None): (source)

Undocumented

def __repr__(self): (source)

Undocumented

@auth.setter
def auth(self, value): (source)

Sets any non-user authentication information associated with the request, such as an authentication token.

def force_plaintext_errors(self, value): (source)

Undocumented

@user.setter
def user(self, value): (source)

Sets the user on the current request. This is necessary to maintain compatibility with django.contrib.auth where the user property is set in the login and logout functions. Note that we also set the user on Django's underlying `HttpRequest` instance, ensuring that it is available to any middleware in the stack.

Returns any non-user authentication information associated with the request, such as an authentication token.

authenticators = (source)

Undocumented

negotiator = (source)

Undocumented

parser_context: dict = (source)

Undocumented

Undocumented

Returns the user associated with the current request, as authenticated by the authentication classes provided to the request.

@property
content_type = (source)

Undocumented

Undocumented

Undocumented

Undocumented

Undocumented

@property
query_params = (source)

More semantically correct name for request.GET.

@property
QUERY_PARAMS = (source)

Undocumented

Returns an object that may be used to stream the request content.

@property
successful_authenticator = (source)

Return the instance of the authentication instance class that was used to authenticate the request, or `None`.

def _authenticate(self): (source)

Attempt to authenticate the request using each authentication instance in turn.

def _default_negotiator(self): (source)

Undocumented

def _load_data_and_files(self): (source)

Parses the request content into `self.data`.

def _load_stream(self): (source)

Return the content body of the request, as a stream.

def _not_authenticated(self): (source)

Set authenticator, user & authtoken representing an unauthenticated request. Defaults are None, AnonymousUser & None.

def _parse(self): (source)

Parse the request content, returning a two-tuple of (data, files) May raise an `UnsupportedMediaType`, or `ParseError` exception.

def _supports_form_parsing(self): (source)

Return True if this requests supports parsing form data.

Undocumented

_authenticator = (source)

Undocumented

_content_type = (source)

Undocumented

Undocumented

Undocumented

_full_data = (source)

Undocumented

_request = (source)

Undocumented

Undocumented

Undocumented