Package mapproxy :: Package core :: Module response :: Class Response
[hide private]
[frames] | no frames]

Class Response

source code

object --+
         |
        Response

Instance Methods [hide private]
 
__init__(self, response, status=None, content_type=None, mimetype=None)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
_status_set(self, status) source code
 
_status_get(self) source code
 
_last_modified_set(self, date) source code
 
_last_modified_get(self) source code
 
_etag_set(self, value) source code
 
_etag_get(self) source code
 
cache_headers(self, timestamp=None, etag_data=None, max_age=None)
Set cache-related headers.
source code
 
make_conditional(self, environ)
Make the response conditional to the HTTP headers in the CGI/WSGI environ.
source code
 
__call__(self, environ, start_response) source code
 
iter_encode(self, chunks) source code

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Class Variables [hide private]
  charset = 'utf-8'
  default_content_type = 'text/plain'
  block_size = 32768
Properties [hide private]
  status
  last_modified
  etag
  content_length
  content_type
  data
  fixed_headers

Inherited from object: __class__

Method Details [hide private]

__init__(self, response, status=None, content_type=None, mimetype=None)
(Constructor)

source code 
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
Overrides: object.__init__
(inherited documentation)

cache_headers(self, timestamp=None, etag_data=None, max_age=None)

source code 
Set cache-related headers.
Parameters:
  • timestamp - local timestamp of the last modification of the response content
  • etag_data - list that will be used to build an ETag hash. calls the str function on each item.
  • max_age - the maximum cache age in seconds

make_conditional(self, environ)

source code 
Make the response conditional to the HTTP headers in the CGI/WSGI environ. Checks for If-none-match and If-modified-since headers and compares to the etag and timestamp of this response. If the content was not modified the repsonse will changed to HTTP 304 Not Modified.

Property Details [hide private]

status

Get Method:
_status_get(self)
Set Method:
_status_set(self, status)

last_modified

Get Method:
_last_modified_get(self)
Set Method:
_last_modified_set(self, date)

etag

Get Method:
_etag_get(self)
Set Method:
_etag_set(self, value)

content_length

Get Method:
unreachable.content_length(self)

content_type

Get Method:
unreachable.content_type(self)

data

Get Method:
unreachable.data(self)

fixed_headers

Get Method:
unreachable.fixed_headers(self)