WebOb
WSGI request and response object
What it is and what it does
WebOb is a mature library that wraps WSGI request environments and response objects to provide a more convenient interface for HTTP handling. It lets you read and write request and response data—parsing headers, query strings, cookies, and form data—without directly manipulating the raw WSGI environ dictionary. The library is bidirectional: you can use it to parse incoming HTTP requests or to construct outgoing responses, making it useful both in WSGI applications and for creating HTTP requests programmatically.
The package is actively maintained by the Pylons Project and has recently addressed multiple security issues related to URL handling and open redirects. It supports a range of Python versions and is designed to work with any WSGI-compliant framework or middleware.
Use it for:
- Parse HTTP request headers, query parameters, and form data in a WSGI application without manual environ manipulation.
- Construct HTTP responses with proper headers, cookies, and content negotiation in web frameworks.
- Build HTTP requests programmatically for testing or client-side use.
- Handle cookie management and SameSite attribute configuration in web applications.
- Normalize and validate Location headers in redirect responses to prevent open redirect vulnerabilities.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
WebOb provides request and response objects that wrap WSGI environments, offering convenient parsing and construction of HTTP requests and responses.
Yes. WebOb is a stable, actively maintained library with low install friction and permissive licensing. Recent security fixes demonstrate ongoing attention to correctness. Install it if you're building or working with WSGI applications and need convenient request/response handling—it's a standard choice in the Python web ecosystem.
Install
webob on PyPI
pip
pip install webobuv
uv add webobpoetry
poetry add webobInstalling WebOb
Before you install
Low install friction with a single pure-Python wheel dependency. Actively maintained with recent security fixes; status is active and latest release was 12 days ago.
License in practice
MIT license is permissive, allowing commercial and private use with minimal restrictions.
Quickstart
pip install webob
from webob import Request, Response
req = Request.blank('/path')
resp = Response('Hello World')
resp.headers['Content-Type'] = 'text/plain'
Requires legacy-cgi on Python 3.13+; verify availability in your target environment.
Verify before relying
- Whether Python 2.7 support is still practical given its EOL status and whether the package's actual test coverage reflects modern Python versions.
- Current state of the legacy-cgi dependency for Python 3.13+ and whether it introduces any compatibility concerns.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (!=3.0.*,!=3.1.*,!=3.2.*,>=2.7) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — legacy-cgi |
| Maintenance | actively maintained — 12 days since the last release |
| First released | |
| Downloads | 6,426,596/month — #1,913 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: webob-1.8.11-py2.py3-none-any.whl
Keywords: wsgi, request, web, http
Tags
More WSGI packages
Werkzeug is a WSGI utility library providing…
permissive · top 1,000 on PyPI
FlaskFlask is a lightweight WSGI web application…
permissive · top 1,000 on PyPI
gunicornGunicorn is a WSGI and ASGI HTTP server for…
permissive · top 1,000 on PyPI
DjangoDjango is a high-level Python web framework for…
permissive · top 1,000 on PyPI
Flask-WTFFlask-WTF integrates WTForms with Flask to…
permissive · top 5,000 on PyPI
Flask-SessionFlask-Session adds server-side session storage…
permissive · top 5,000 on PyPI
PastePaste provides WSGI middleware components for…
permissive · top 5,000 on PyPI
peppercornPeppercorn converts token streams into nested…
permissive · top 15,000 on PyPI
WSGIProxy2WSGIProxy2 wraps a remote HTTP application as a…
permissive · top 15,000 on PyPI
pyramidPyramid is a Python web framework for building…
permissive · top 5,000 on PyPI
cookiesParses and renders HTTP Cookie and Set-Cookie…
permissive · top 15,000 on PyPI
django-cors-headersAdds Cross-Origin Resource Sharing (CORS)…
permissive · top 1,000 on PyPI
repoze.whorepoze.who is an identification and…
permissive · top 15,000 on PyPI
apig-wsgiWraps a WSGI application to run as an AWS…
permissive · top 15,000 on PyPI
PasteDeployPasteDeploy loads and configures WSGI…
permissive · top 5,000 on PyPI
oslo.middlewareoslo.middleware provides WSGI middleware…
permissive · top 15,000 on PyPI