Documentation for pulsar 0.7.2. For development docs, go here.
This section introduces two classes used by pulsar wsgi application to pass a request/response state during an HTTP request. The WsgiRequest is a thin wrapper around a WSGI environ dictionary. It contains only the environ as its private data. The WsgiResponse, which is available in the WsgiRequest.response attribute, is an iterable over bytestring with several utility methods for manipulating headers and asynchronous content.
A wrapper around a WSGI environ. Instances of this class have the environ attribute as their only private data. Every other attribute is stored in the environ itself at the pulsar.cache wsgi-extension key.
An EnvironMixin for wsgi requests.
List of content types this client supports.
List of charsets this client supports as CharsetAccept object.
List of encodings this client accepts. Encodings in a HTTP term are compression encodings such as gzip. For charsets have a look at accept_charset.
List of languages this client accepts as LanguageAccept object.
The WSGI application handling this request.
Shortcut to the environ PATH_INFO value.
The request method (uppercase).
Retrieve body data.
Returns a two-elements tuple of a pulsar.utils.structures.MultiValueDict containing data from the request body, and data from uploaded files.
If the body data is not ready, return a pulsar.Deferred which results in the tuple.
The result is cached.
A pulsar.utils.structures.MultiValueDict containing data from the request body.
A pulsar.utils.structures.MultiValueDict containing data from the QUERY_STRING in environ.
Returns the HTTP host using the environment or request headers.
Return a full path
A WSGI response.
Instances are callable using the standard WSGI call and, importantly, iterable:
response = WsgiResponse(200)
A WsgiResponse is an iterable over bytes to send back to the requesting client.
Integer indicating the HTTP status, (i.e. 200)
String indicating the HTTP status (i.e. ‘OK’)
String indicating the HTTP status code and response (i.e. ‘200 OK’)
The content type of this response. Can be None.
The dictionary of WSGI environment if passed to the constructor.
Check if the response is streamed.
A streamed response is an iterable with no length information. In this case streamed means that there is no information about the number of iterations.
This is usually True if a generator is passed to the response object.
Sets a cookie.
expires can be a string in the correct format or a datetime.datetime object in UTC. If expires is a datetime object then max_age will be calculated.