Skip to main content
Python Software Foundation 20th Year Anniversary Fundraiser  Donate today!

WSGI request and response object

Project description Documentation Status

WebOb provides objects for HTTP requests and responses. Specifically it does this by wrapping the WSGI request environment and response status/headers/app_iter(body).

The request and response objects provide many conveniences for parsing HTTP request and forming HTTP responses. Both objects are read/write: as a result, WebOb is also a nice way to create HTTP requests and parse HTTP responses.

Support and Documentation

See the WebOb Documentation website to view documentation, report bugs, and obtain support.


WebOb is offered under the MIT-license.


WebOb was authored by Ian Bicking and is currently maintained by the Pylons Project and a team of contributors.

1.5.1 (2015-10-30)

Bug Fixes

  • The exceptions HTTPNotAcceptable, HTTPUnsupportedMediaType and HTTPNotImplemented will now correctly use the sub-classed template rather than the default error template. See
  • Response’s from_file now correctly deals with a status line that contains an HTTP version identifier. HTTP/1.1 200 OK is now correctly parsed, whereas before this would raise an error upon setting the Response.status in from_file. See

1.5.0 (2015-10-11)

Bug Fixes

  • The cookie API functions will now make sure that max_age is an integer or an string that can convert to an integer. Previously passing in max_age=’test’ would have silently done the wrong thing.

1.5.0b0 (2015-09-06)

Bug Fixes


1.5.0a1 (2015-07-30)

Backwards Incompatibilities

  • Response.set_cookie renamed the only required parameter from “key” to “name”. The code will now still accept “key” as a keyword argument, and will issue a DeprecationWarning until WebOb 1.7.
  • The status attribute of a Response object no longer takes a string like None None and allows that to be set as the status. It now has to at least match the pattern of <integer status code> <explenation of status code>. Invalid status strings will now raise a ValueError.

1.5.0a0 (2015-07-25)

Backwards Incompatibilities

  • Morsel will no longer accept a cookie value that does not meet RFC6265’s cookie-octet specification. Upon calling Morsel.serialize a warning will be issued, in the future this will raise a ValueError, please update your cookie handling code. See

    The cookie-octet specification in RFC6265 states the following characters are valid in a cookie value:

    Hex Range Actual Characters
    [0x21     ] !
    [0x25-0x2B] #$%&'()*+
    [0x2D-0x3A] -./0123456789:
    [0x5D-0x7E] ]^_`abcdefghijklmnopqrstuvwxyz{|}~

    RFC6265 suggests using base 64 to serialize data before storing data in a cookie.

    Cookies that meet the RFC6265 standard will no longer be quoted, as this is unnecessary. This is a no-op as far as browsers and cookie storage is concerned.

  • Response.set_cookie now uses the internal make_cookie API, which will issue warnings if cookies are set with invalid bytes. See


  • Add support for some new caching headers, stale-while-revalidate and stale-if-error that can be used by reverse proxies to cache stale responses temporarily if the backend disappears. From RFC5861. See

Bug Fixes

Documentation Changes

Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for WebOb, version 1.5.1
Filename, size File type Python version Upload date Hashes
Filename, size WebOb-1.5.1-py2.py3-none-any.whl (79.9 kB) File type Wheel Python version 3.4 Upload date Hashes View
Filename, size WebOb-1.5.1.tar.gz (202.8 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page