Request

The Request class encapsulates a request, as well as providing commonly needed parsing, such as cookies, querystrings, and body.

class Request(app, environ)
path

The requested URI

method

The HTTP Verb used in this request (e.g. GET, POST, OPTIONS, etc)

content_type

The supplied content type of this request.

content_params

A dict containing any additional parameters passed in the content type header.

raw_cookies

A SimpleCookie object.

cookies

A simpler interface to raw_cookies, which is a dict of simply keys and values.

body

The raw contents of the request body.

query_data

A dict of data parsed from the query string.

request_data

If the request content is a HTTP Form, returns the parsed data.

The following attributes are lazy, and only parsed when accessed:

  • raw_cookies
  • cookies (reads raw_cookies)
  • query_data
  • body
  • request_data (reads body)