[top] / zope / publisher / interfaces / http / IHTTPApplicationRequest
HTTP request data.
This object provides access to request data. This includes, the input headers, server data, and cookies.
Request objects are created by the object publisher and will be passed to published objects through the argument name, REQUEST.
The request object is a mapping object that represents a collection of variable to value mappings. In addition, variables are divided into four categories:
Environment variables
These variables include input headers, server data, and other request-related data. The variable names are as <a href="http://hoohoo.ncsa.uiuc.edu/cgi/env.html">specified</a> in the <a href="http://hoohoo.ncsa.uiuc.edu/cgi/interface.html">CGI specification</a>
Cookies
These are the cookie data, if present.
Other
Data that may be set by an application object.
The request object may be used as a mapping object, in which case values will be looked up in the order: environment variables, other variables, cookies, and special.
cookies
(Attribute)
Request cookie data
This is a read-only mapping from variable name to value.
principal
(Attribute)
Principal object associated with the request This is a read-only attribute.
environment
(Attribute)
Request environment data
This is a read-only mapping from variable name to value.
URL
(Attribute)
Request URL data
When converted to a string, this gives the effective published URL.
This object can also be used as a mapping object. The key must be an integer or a string that can be converted to an integer. A non-negative integer returns a URL n steps from the URL of the top-level application objects. A negative integer gives a URL that is -n steps back from the effective URL.
For example, 'request.URL[-2]' is equivalent to the Zope 2 'request["URL2"]'. The notion is that this would be used in path expressions, like 'request/URL/-2'.
bodyStream
(Attribute)
The stream that provides the data of the request.
The data returned by the stream will not include any possible header information, which should have been stripped by the server (or previous layer) before.
Also, the body stream might already be read and not return any data. This is commonly done when retrieving the data for the body attribute.
If you access this stream directly to retrieve data, it will not be possible by other parts of the framework to access the data of the request via the body attribute.
annotations
(Attribute)
Stores arbitrary application data under package-unique keys.
By "package-unique keys", we mean keys that are are unique by virtue of including the dotted name of a package as a prefex. A package name is used to limit the authority for picking names for a package to the people using that package.
For example, when implementing annotations for hypothetical request-persistent adapters in a hypothetical zope.persistentadapter package, the key would be (or at least begin with) the following:
"zope.persistentadapter"
headers
(Attribute)
Request header data
This is a read-only mapping from variable name to value. It does not support iteration.
debug
(Attribute)
Debug flags (see IDebugFlags).
* = required
getURL(level=0, path_only=False)
Return the published URL with level names removed from the end.
If path_only is true, then only a path will be returned.
setVirtualHostRoot(names)
Marks the currently traversed object as the root of a virtual host.
Any path elements traversed up to that
Set the names which compose the application path. These are the path elements that appear in the beginning of the generated URLs.
Should be called during traversal.
__getitem__(key)
Return HTTP request data
Request data sre retrieved from one of:
Environment variables
These variables include input headers, server data, and other request-related data. The variable names are as <a href="http://hoohoo.ncsa.uiuc.edu/cgi/env.html">specified</a> in the <a href="http://hoohoo.ncsa.uiuc.edu/cgi/interface.html">CGI specification</a>
Cookies
These are the cookie data, if present.
Cookies are searched before environmental data.
get(key, default=None)
Get a value for a key
The default is returned if there is no value for the key.
keys()
Return the keys of the mapping object.
items()
Return the items of the mapping object.
getHeader(name, default=None, literal=False)
Get a header value
Return the named HTTP header, or an optional default argument or None if the header is not found. Note that both original and CGI-ified header names are recognized, e.g. 'Content-Type', 'CONTENT_TYPE' and 'HTTP_CONTENT_TYPE' should all return the Content-Type header, if available.
If the literal argument is passed, the header is searched 'as is', eg: only if the case matches.
__contains__(key)
Tell if a key exists in the mapping.
setApplicationServer(host, proto='http', port=None)
Override the host, protocol and port parts of generated URLs.
This affects automatically inserted <base> tags and URL getters in the request, but not things like @@absolute_url views.
getApplicationURL(depth=0, path_only=False)
Return the application URL plus depth steps
If path_only is true, then only a path will be returned.
__iter__()
Return an iterator for the keys of the mapping object.
getCookies()
Return the cookie data
Data are returned as a mapping object, mapping cookie name to value.
values()
Return the values of the mapping object.
__len__()
Return the number of items.
getVirtualHostRoot()
Returns the object which is the virtual host root for this request
Return None if setVirtualHostRoot hasn't been called.
shiftNameToApplication()
Add the name being traversed to the application name
This is only allowed in the case where the name is the first name.
A Value error is raised if the shift can't be performed.
There are no specific adapters registered for this interface.
zope.viewlet.metaconfigure.JavaScriptViewlet
(name: boston.js)
zope.viewlet.manager.<ViewletManager providing IJavaScript>
(name: zope.app.boston.IJavaScript)
zope.viewlet.viewlet.SimpleViewletClass from /opt/zope/sr/apidoc/src/zope/app/boston/viewlets/toolbar/viewlet.pt
(name: toolbar)
zope.traversing.namespace.lang
(name: lang)
zope.viewlet.manager.<ViewletManager providing ICSS>
(name: zope.app.boston.ICSS)
zope.traversing.namespace.acquire
(name: acquire)
zope.traversing.namespace.acquire
(name: acquire)
zope.traversing.namespace.acquire
(name: acquire)
zope.traversing.namespace.acquire
(name: acquire)
zope.app.apidoc.codemodule.browser.introspector.annotationsNamespace
(name: annotations)
zope.app.apidoc.codemodule.browser.introspector.annotationsNamespace
(name: annotations)
zope.app.apidoc.codemodule.browser.introspector.annotationsNamespace
(name: annotations)
zope.app.apidoc.codemodule.browser.introspector.annotationsNamespace
(name: annotations)
zope.viewlet.metaconfigure.CSSViewlet
(name: xmltree.css)
zope.app.pagetemplate.urlquote.URLQuote
(name: url)
zope.viewlet.viewlet.SimpleViewletClass from /opt/zope/sr/apidoc/src/zope/app/boston/viewlets/xmltree/xmltree.pt
(name: xmltree)
zope.viewlet.metaconfigure.CSSViewlet
(name: skin.css)
zope.app.preference.preference.preferencesNamespace
(name: preferences)
zope.app.preference.default.DefaultPreferences
(name: preferences)
zope.traversing.namespace.attr
(name: attribute)
zope.traversing.namespace.attr
(name: attribute)
zope.traversing.namespace.attr
(name: attribute)
zope.traversing.namespace.attr
(name: attribute)
zope.viewlet.manager.<ViewletManager providing IHead>
(name: zope.app.boston.IHead)
zope.app.component.back35.RegistrationManagerNamespace
(name: registrations)
zope.viewlet.manager.<ViewletManager providing ILeft>
(name: zope.app.boston.ILeft)
zope.traversing.namespace.resource
(name: resource)
zope.traversing.namespace.resource
(name: resource)
zope.traversing.namespace.resource
(name: resource)
zope.traversing.namespace.resource
(name: resource)
zope.traversing.namespace.etc
(name: etc)
zope.traversing.namespace.etc
(name: etc)
zope.traversing.namespace.etc
(name: etc)
zope.traversing.namespace.etc
(name: etc)
zope.traversing.namespace.etc
(name: etc)
zope.app.apidoc.apidoc.apidocNamespace
(name: apidoc)
zope.app.apidoc.apidoc.apidocNamespace
(name: apidoc)
zope.app.apidoc.apidoc.apidocNamespace
(name: apidoc)
zope.app.apidoc.apidoc.apidocNamespace
(name: apidoc)
zope.traversing.namespace.acquire
(name: acquire)
zope.traversing.namespace.lang
(name: lang)
zope.traversing.namespace.lang
(name: lang)
zope.traversing.namespace.lang
(name: lang)
zope.traversing.namespace.lang
(name: lang)
zope.traversing.namespace.item
(name: item)
zope.traversing.namespace.item
(name: item)
zope.traversing.namespace.item
(name: item)
zope.traversing.namespace.item
(name: item)
zope.traversing.namespace.item
(name: item)
zope.viewlet.metaconfigure.JavaScriptViewlet
(name: xmltree)
zope.viewlet.metaconfigure.CSSViewlet
(name: toolbar-css)
zope.traversing.namespace.adapter
(name: adapter)
zope.app.apidoc.apidoc.apidocNamespace
(name: apidoc)
zope.traversing.namespace.vh
(name: vh)
zope.traversing.namespace.vh
(name: vh)
zope.traversing.namespace.vh
(name: vh)
zope.traversing.namespace.vh
(name: vh)
zope.app.onlinehelp.helpNamespace
(name: help)
zope.app.onlinehelp.helpNamespace
(name: help)
zope.app.onlinehelp.helpNamespace
(name: help)
zope.app.onlinehelp.helpNamespace
(name: help)
zope.app.onlinehelp.helpNamespace
(name: help)
zope.traversing.namespace.adapter
(name: adapter)
zope.traversing.namespace.adapter
(name: adapter)
zope.traversing.namespace.adapter
(name: adapter)
zope.traversing.namespace.adapter
(name: adapter)
zope.traversing.namespace.debug
(name: debug)
zope.traversing.namespace.debug
(name: debug)
zope.traversing.namespace.debug
(name: debug)
zope.traversing.namespace.debug
(name: debug)
zope.app.pagetemplate.talesapi.ZopeTalesAPI
(name: zope)
zope.traversing.namespace.attr
(name: attribute)
zope.app.preference.preference.preferencesNamespace
(name: preferences)
zope.app.preference.preference.preferencesNamespace
(name: preferences)
zope.app.preference.preference.preferencesNamespace
(name: preferences)
zope.app.preference.preference.preferencesNamespace
(name: preferences)
zope.app.apidoc.codemodule.browser.introspector.annotationsNamespace
(name: annotations)
zope.traversing.namespace.view
(name: view)
zope.traversing.namespace.view
(name: view)
zope.traversing.namespace.view
(name: view)
zope.traversing.namespace.view
(name: view)
zope.formlib.namedtemplate.NamedTemplatePathAdapter
(name: template)
zope.viewlet.manager.<ViewletManager providing IToolBar>
(name: zope.app.boston.IToolBar)
zope.viewlet.metaconfigure.CSSViewlet
(name: widget.css)
There are no views available.
There are no views available.
There are no views available.
There are no views available.
There are no views available.
There are no views available.
There are no views available.
There are no views available.
There are no views available.
There are no views available.
There are no views available.
There are no views available.