The Request class is accessible via the webob module.
Return a MultiDict containing all the variables from a POST form request. Does not return anything for non-POST requests or for non-form requests (returns empty dict-like object in that case).
Access the body of the request (wsgi.input) as a file-like object.
If you set this value, CONTENT_LENGTH will also be updated (either set to -1, 0 if you delete the attribute, or if you set the attribute to a string then the length of the string).
Returns a boolean if X-Requested-With is present and XMLHttpRequest
Note: this isn't set by every XMLHttpRequest request, it is only set if you are using a Javascript library that sets it (or you set the header yourself manually). Currently Prototype and jQuery are known to set this header.
Return any named variables matched in the URL.
Takes values from environ['wsgiorg.routing_args']. Systems like routes set this value.
Return any positional variables matched in the URL.
Takes values from environ['wsgiorg.routing_args']. Systems like routes set this value.
A dictionary-like object containing both the parameters from the query string and request body.
Resolve other_url relative to the request URL.
If to_application is True, then resolve it relative to the URL with only SCRIPT_NAME
'Pops' off the next segment of PATH_INFO, pushing it onto SCRIPT_NAME, and returning the popped segment. Returns None if there is nothing left on PATH_INFO.
Does not return '' when there's an empty segment (like /path//path); these segments are just ignored.
Returns the next segment on PATH_INFO, or None if there is no next segment. Doesn't modify the environment.
Copy the request and environment object.
This only does a shallow copy, except of wsgi.input
Copies the request and environment object, but turning this request into a GET along the way. If this was a POST request (or any other verb) then it becomes GET, and the request body is thrown away.
Remove headers that make the request conditional.
These headers can cause the response to be 304 Not Modified, which in some cases you may not want to be possible.
This does not remove headers like If-Match, which are used for conflict detection.
Call the given WSGI application, returning (status_string, headerlist, app_iter)
Be sure to call app_iter.close() if it's there.
If catch_exc_info is true, then returns (status_string, headerlist, app_iter, exc_info), where the fourth item may be None, but won't be if there was an exception. If you don't do this and there was an exception, the exception will be raised directly.
Like .call_application(application), except returns a response object with .status, .headers, and .body attributes.
This will use self.ResponseClass to figure out the class of the response object to return.
Create a blank request environ (and Request wrapper) with the given path (path should be urlencoded), and any keys from environ.
The path will become path_info, with any query string split off and used.
All necessary keys will be added to the environ, but the values you pass in will take precedence. If you pass in base_url then wsgi.url_scheme, HTTP_HOST, and SCRIPT_NAME will be filled in from that value.
Any extra keyword will be passed to __init__ (e.g., decode_param_names).
See the source for more information.