HTTP response objects. Ported from webapp2, refactored to support Python versions > 2.7, 3.0
Implements methods from wsgiref.headers.Headers, used by webtools.
Extended header setting.
_name is the header field to add. keyword arguments can be used to set additional parameters for the header field, with underscores converted to dashes. Normally the parameter will be added as key=”value” unless value is None, in which case only the key will be added.
Example:
h.add_header('content-disposition', 'attachment', filename='bud.gif')
Note that unlike the corresponding ‘email.message’ method, this does not handle ‘(charset, language, value)’ tuples: all values must be strings or None.
Abstraction for an HTTP response.
The status string, including code and message.
Sets the HTTP status code of this response.
Parameters: |
|
---|
The response status message, as a string.
The headers as a dictionary-like object.
Clears all data written to the output stream so that it is empty.
Returns the default HTTP status message for the given code.
Parameters: | code – The HTTP code for which we want a message. |
---|
alias of Request