Latest Version: 0.9.6.2

Response


Attributes

a charset

Get/set the charset (in the Content-Type)

a content

Get/set the specified content, where content can be: a string, a list of strings, a generator function that yields strings, or an iterable object that produces strings.

a content_type

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 defaults

{'headers': {'Cache-Control': 'no-cache'}, 'errors': 'strict', 'charset': 'utf-8', 'content_type': 'text/html'}

Methods

f __call__(self, environ, start_response) ...

Convenience call to return output and set status information

Conforms to the WSGI interface for calling purposes only.

Example usage:

1
2
3
4
5
def wsgi_app(environ, start_response):
    response = WSGIResponse()
    response.write("Hello world")
    response.headers['Content-Type'] = 'latin1'
    return response(environ, start_response)

f __init__(self, *args, **kwargs) ...

See the source for more information.

Top