Home | Trees | Indices | Help |
---|
|
object --+ | Response
Represents a WSGI response
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
Inherited from |
|
|||
|
|
|||
_etag_raw Gets and sets the ``ETag`` header (`HTTP spec section 14.19 <http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.19>`_). |
|||
accept_ranges Gets and sets the ``Accept-Ranges`` header (`HTTP spec section 14.5 <http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.5>`_). |
|||
age Gets and sets the ``Age`` header (`HTTP spec section 14.6 <http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.6>`_). |
|||
allow Gets and sets the ``Allow`` header (`HTTP spec section 14.7 <http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.7>`_). |
|||
app_iter Returns the app_iter of the response. |
|||
body The body of the response, as a ``str``. |
|||
body_file A file-like object that can be used to write to the body. |
|||
cache_control Get/set/modify the Cache-Control header (`HTTP spec section 14.9 <http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9>`_) |
|||
cache_expires | |||
charset Get/set the charset (in the Content-Type) |
|||
content_disposition Gets and sets the ``Content-Disposition`` header (`HTTP spec section 19.5.1 <http://www.w3.org/Protocols/rfc2616/rfc2616-sec19.html#sec19.5.1>`_). |
|||
content_encoding Gets and sets the ``Content-Encoding`` header (`HTTP spec section 14.11 <http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.11>`_). |
|||
content_language Gets and sets the ``Content-Language`` header (`HTTP spec section 14.12 <http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.12>`_). |
|||
content_length Gets and sets the ``Content-Length`` header (`HTTP spec section 14.17 <http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.17>`_). |
|||
content_location Gets and sets the ``Content-Location`` header (`HTTP spec section 14.14 <http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.14>`_). |
|||
content_md5 Gets and sets the ``Content-MD5`` header (`HTTP spec section 14.14 <http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.14>`_). |
|||
content_range Gets and sets the ``Content-Range`` header (`HTTP spec section 14.16 <http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.16>`_). |
|||
content_type Get/set the Content-Type header (or None), *without* the charset or any parameters. |
|||
content_type_params A dictionary of all the parameters in the content type. |
|||
date Gets and sets the ``Date`` header (`HTTP spec section 14.18 <http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.18>`_). |
|||
etag Gets and sets the ``ETag`` header (`HTTP spec section 14.19 <http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.19>`_). |
|||
etag_strong | |||
expires Gets and sets the ``Expires`` header (`HTTP spec section 14.21 <http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.21>`_). |
|||
headerlist The list of response headers |
|||
headers The headers in a dictionary-like object |
|||
json Access the body of the response as JSON |
|||
json_body Access the body of the response as JSON |
|||
last_modified Gets and sets the ``Last-Modified`` header (`HTTP spec section 14.29 <http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.29>`_). |
|||
location Gets and sets the ``Location`` header (`HTTP spec section 14.30 <http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.30>`_). |
|||
pragma Gets and sets the ``Pragma`` header (`HTTP spec section 14.32 <http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.32>`_). |
|||
retry_after Gets and sets the ``Retry-After`` header (`HTTP spec section 14.37 <http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.37>`_). |
|||
server Gets and sets the ``Server`` header (`HTTP spec section 14.38 <http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.38>`_). |
|||
status The status string |
|||
status_code The status as an integer |
|||
status_int The status as an integer |
|||
text Get/set the text value of the body (using the charset of the Content-Type) |
|||
ubody Deprecated alias for .text |
|||
unicode_body Deprecated alias for .text |
|||
vary Gets and sets the ``Vary`` header (`HTTP spec section 14.44 <http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.44>`_). |
|||
www_authenticate Gets and sets the ``WWW-Authenticate`` header (`HTTP spec section 14.47 <http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.47>`_). |
|||
Inherited from |
|
x.__init__(...) initializes x; see help(type(x)) for signature
|
repr(x)
|
str(x)
|
Returns the app_iter of the response. If body was set, this will create an app_iter from that body (a single-item list) |
The body of the response, as a ``str``. This will read in the entire app_iter if necessary. |
A file-like object that can be used to write to the body. If you passed in a list app_iter, that app_iter will be modified by writes. |
Set expiration on this request. This sets the response to expire in the given seconds, and any other attributes are used for cache_control (e.g., private=True, etc). |
Get/set the Content-Type header (or None), *without* the charset or any parameters. If you include parameters (or ``;`` at all) when setting the content_type, any existing parameters will be deleted; otherwise they will be preserved. |
A dictionary of all the parameters in the content type. (This is not a view, set to change, modifications of the dict would not be applied otherwise) |
Like the normal __call__ interface, but checks conditional headers: * If-Modified-Since (304 Not Modified; only on GET, HEAD) * If-None-Match (304 Not Modified; only on GET, HEAD) * Range (406 Partial Content; only on GET, HEAD) |
Delete a cookie from the client. Note that path and domain must match how the cookie was originally set. This sets the cookie to the empty string, and max_age=0 so that it should expire immediately. |
Reads a response from a file-like object (it must implement ``.read(size)`` and ``.readline()``). It will read up to the end of the response, not the end of the file. This reads the response as represented by ``str(resp)``; it may not read every valid HTTP response properly. Responses must have a ``Content-Length`` |
Generate an etag for the response object using an MD5 hash of the body (the body parameter, or ``self.body`` if not given) Sets ``self.etag`` If ``set_content_md5`` is True sets ``self.content_md5`` as well |
Merge the cookies that were set on this response with the given `resp` object (which can be any WSGI application). If the `resp` is a :class:`webob.Response` object, then the other object will be modified in-place. |
Set (add) a cookie for the response. Arguments are: ``key`` The cookie name. ``value`` The cookie value, which should be a string or ``None``. If ``value`` is ``None``, it's equivalent to calling the :meth:`webob.response.Response.unset_cookie` method for this cookie key (it effectively deletes the cookie on the client). ``max_age`` An integer representing a number of seconds or ``None``. If this value is an integer, it is used as the ``Max-Age`` of the generated cookie. If ``expires`` is not passed and this value is an integer, the ``max_age`` value will also influence the ``Expires`` value of the cookie (``Expires`` will be set to now + max_age). If this value is ``None``, the cookie will not have a ``Max-Age`` value (unless ``expires`` is also sent). ``path`` A string representing the cookie ``Path`` value. It defaults to ``/``. ``domain`` A string representing the cookie ``Domain``, or ``None``. If domain is ``None``, no ``Domain`` value will be sent in the cookie. ``secure`` A boolean. If it's ``True``, the ``secure`` flag will be sent in the cookie, if it's ``False``, the ``secure`` flag will not be sent in the cookie. ``httponly`` A boolean. If it's ``True``, the ``HttpOnly`` flag will be sent in the cookie, if it's ``False``, the ``HttpOnly`` flag will not be sent in the cookie. ``comment`` A string representing the cookie ``Comment`` value, or ``None``. If ``comment`` is ``None``, no ``Comment`` value will be sent in the cookie. ``expires`` A ``datetime.timedelta`` object representing an amount of time or the value ``None``. A non-``None`` value is used to generate the ``Expires`` value of the generated cookie. If ``max_age`` is not passed, but this value is not ``None``, it will influence the ``Max-Age`` header (``Max-Age`` will be 'expires_value - datetime.utcnow()'). If this value is ``None``, the ``Expires`` cookie value will be unset (unless ``max_age`` is also passed). ``overwrite`` If this key is ``True``, before setting the cookie, unset any existing cookie. |
|
_etag_rawGets and sets the ``ETag`` header (`HTTP spec section 14.19 <http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.19>`_).
|
accept_rangesGets and sets the ``Accept-Ranges`` header (`HTTP spec section 14.5 <http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.5>`_).
|
ageGets and sets the ``Age`` header (`HTTP spec section 14.6 <http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.6>`_). Converts it using int.
|
allowGets and sets the ``Allow`` header (`HTTP spec section 14.7 <http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.7>`_). Converts it using list.
|
app_iterReturns the app_iter of the response. If body was set, this will create an app_iter from that body (a single-item list)
|
bodyThe body of the response, as a ``str``. This will read in the entire app_iter if necessary.
|
body_fileA file-like object that can be used to write to the body. If you passed in a list app_iter, that app_iter will be modified by writes.
|
cache_controlGet/set/modify the Cache-Control header (`HTTP spec section 14.9 <http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9>`_)
|
cache_expires
|
charsetGet/set the charset (in the Content-Type)
|
content_dispositionGets and sets the ``Content-Disposition`` header (`HTTP spec section 19.5.1 <http://www.w3.org/Protocols/rfc2616/rfc2616-sec19.html#sec19.5.1>`_).
|
content_encodingGets and sets the ``Content-Encoding`` header (`HTTP spec section 14.11 <http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.11>`_).
|
content_languageGets and sets the ``Content-Language`` header (`HTTP spec section 14.12 <http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.12>`_). Converts it using list.
|
content_lengthGets and sets the ``Content-Length`` header (`HTTP spec section 14.17 <http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.17>`_). Converts it using int.
|
content_locationGets and sets the ``Content-Location`` header (`HTTP spec section 14.14 <http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.14>`_).
|
content_md5Gets and sets the ``Content-MD5`` header (`HTTP spec section 14.14 <http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.14>`_).
|
content_rangeGets and sets the ``Content-Range`` header (`HTTP spec section 14.16 <http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.16>`_). Converts it using ContentRange object.
|
content_typeGet/set the Content-Type header (or None), *without* the charset or any parameters. If you include parameters (or ``;`` at all) when setting the content_type, any existing parameters will be deleted; otherwise they will be preserved.
|
content_type_paramsA dictionary of all the parameters in the content type. (This is not a view, set to change, modifications of the dict would not be applied otherwise)
|
dateGets and sets the ``Date`` header (`HTTP spec section 14.18 <http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.18>`_). Converts it using HTTP date.
|
etagGets and sets the ``ETag`` header (`HTTP spec section 14.19 <http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.19>`_). Converts it using Entity tag.
|
etag_strong
|
expiresGets and sets the ``Expires`` header (`HTTP spec section 14.21 <http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.21>`_). Converts it using HTTP date.
|
headerlistThe list of response headers
|
headersThe headers in a dictionary-like object
|
jsonAccess the body of the response as JSON
|
json_bodyAccess the body of the response as JSON
|
last_modifiedGets and sets the ``Last-Modified`` header (`HTTP spec section 14.29 <http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.29>`_). Converts it using HTTP date.
|
locationGets and sets the ``Location`` header (`HTTP spec section 14.30 <http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.30>`_).
|
pragmaGets and sets the ``Pragma`` header (`HTTP spec section 14.32 <http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.32>`_).
|
retry_afterGets and sets the ``Retry-After`` header (`HTTP spec section 14.37 <http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.37>`_). Converts it using HTTP date or delta seconds.
|
serverGets and sets the ``Server`` header (`HTTP spec section 14.38 <http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.38>`_).
|
statusThe status string
|
status_codeThe status as an integer
|
status_intThe status as an integer
|
textGet/set the text value of the body (using the charset of the Content-Type)
|
ubodyDeprecated alias for .text
|
unicode_bodyDeprecated alias for .text
|
varyGets and sets the ``Vary`` header (`HTTP spec section 14.44 <http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.44>`_). Converts it using list.
|
www_authenticateGets and sets the ``WWW-Authenticate`` header (`HTTP spec section 14.47 <http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.47>`_). Converts it using ``parse_auth`` and ``serialize_auth``.
|
Home | Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 on Sat Feb 9 17:17:56 2013 | http://epydoc.sourceforge.net |