Add Response.json and Request.json which reads and sets the body using a JSON encoding (previously only the readable attribute Request.json_body existed). Request.json_body is still available as an alias.
Rename Response.status_int to Response.status_code (the .status_int name is still available and will be supported indefinitely).
Add Request.text, the unicode version of the request body (similar to Response.text).
Add webob.client which contains the WSGI application send_request_app and SendRequest. All requests sent to this application are turned into HTTP requests.
Renamed Request.get_response(app) to Request.send(app). The .get_response() name is still available.
Use send_request_app as the default application for Request.send(), so you can do:
resp = Request.blank("http://python.org").send()
Add webob.static which contains two new WSGI applications, FileApp serve one static file and DirectoryApp to serve the content of a directory. They should provide a reusable implementation of WebOb File-Serving Example. It also comes with support for wsgi.file_wrapper.
The implementation has been imported and simplified from PasteOb.fileapp.
Add dev and docs setup.py aliases (to install development and docs dependencies respectively, e.g. “python setup.py dev”).
Added request.host_port API (returns port number implied by HTTP_HOST, falling back to SERVER_PORT).
Added request.client_addr API (returns IP address implied by HTTP_X_FORWARDED_FOR, falling back to REMOTE_ADDR).
Fix corner-case response.status_int and response.status mutation bug on py3 (use explicit floor division).
Backwards incompatibility: Request and BaseRequest objects now return Unicode for request.path_info and request.script_name under Python 2. Rationale: the legacy behavior of returning the respective raw environ values was nonsensical on Python 3. Working with non-ascii encoded environ variables as raw WSGI values under Python 3 makes no sense, as PEP 3333 specifies that environ variables are bytes-tunneled-as-latin-1 strings.
If you don’t care about Python 3, and you need strict backwards compatibility, to get legacy behavior of returning bytes on Python 2 for these attributes, use webob.LegacyRequest instead of webob.Request. Although it’s possible to use webob.LegacyRequest under Python 3, it makes no sense, and it should not be used there.
The above backwards incompatibility fixed nonsensical behavior of request.host_url, request.application_url, request.path_url, request.path, request.path_qs, request.url, request.relative_url, request.path_info_peek, request.path_info_pop under Python 3. These methods previously dealt with raw SCRIPT_NAME and PATH_INFO values, which caused nonsensical results.
The WebOb Request object now respects an additional WSGI environment variable: webob.url_encoding. webob.url_encoding will be used to decode the raw WSGI PATH_INFO and SCRIPT_NAME variables when the request.path_info and request.script_name APIs are used.
Request objects now accept an additional constructor parameter: url_encoding. url_encoding will be used to decode PATH_INFO and SCRIPT_NAME from its WSGI-encoded values. If webob.url_encoding is not set in the environ and url_encoding is not passed to the Request constructor, the default value utf-8 will be used to decode the PATH_INFO and SCRIPT_NAME.
Note that passing url_encoding will cause the WSGI environment variable webob.url_encoding to be set.
Fix webob.response._request_uri internal function to generate sensible request URI under Python 3. This fixed a problem under Python 3 if you were using non-absolute Location headers in responses.
First release. Nothing is new, or everything is new, depending on how you think about it.