An HTTP request.
This object represents the metadata of an HTTP request message; that is, it contains attributes which describe the environment in which the request URL, headers, and body were sent (if you want tools to interpret the headers and body, those are elsewhere, mostly in Tools). This ‘metadata’ consists of socket data, transport characteristics, and the Request-Line. This object also contains data regarding the configuration in effect for the given URL, and the execution plan for generating a response.
If the request Content-Type is ‘application/x-www-form-urlencoded’ or multipart, this will be a dict of the params pulled from the entity body; that is, it will be the portion of request.params that come from the message body (sometimes called “POST params”, although they can be sent with various HTTP method verbs). This value is set between the ‘before_request_body’ and ‘before_handler’ hooks (assuming that process_request_body is True).
Deprecated in 3.2, will be removed for 3.3 in favor of request.body.params.
Modify cherrypy.response status, headers, and body to represent self.
CherryPy uses this internally, but you can also use it to create an HTTPError object and set its output without raising the exception.
Process the Request. (Core)
method, path, query_string, and req_protocol should be pulled directly from the Request-Line (e.g. “GET /path?key=val HTTP/1.0”).
When run() is done, the returned object should have 3 attributes:
- status, e.g. “200 OK”
- header_list, a list of (name, value) tuples
- body, an iterable yielding strings
Consumer code (HTTP servers) should then access these response attributes to build the outbound stream.
An HTTP Response, including status, headers, and body.
If now > self.time + self.timeout, set self.timed_out.
This purposefully sets a flag, rather than raising an error, so that a monitor thread can interrupt the Response thread.