isoTope Documentation: Request object
The Request object is the heart of the AtomAPI implementation, it is the encapsulation of an Atom HTTP request. It does not replace the standard PHP variables, but as a supplement.
Each atom request created an instance of this object named
$req. This object is global so to use it add
global $req; to each method that needs to reference this object.
Request object offers the following variables and methods:
This contains a reference to the DOM-representation of the received XML document. It is populated when the HTTP method is
A copy of the PHP variable
$_GET. Useful on
DELETE HTTP methods.
This contains the domain name of the current implementation. Used for creating URLs.
This returns the prefix of the request that maps to the root of the Atom implementation.
This returns the HTTP method of the current request.
This returns the specified HTTP Content-Type of the request, which specifies the content-type of the HTTP Request entity body. This would be
application/x.atom+xml for AtomAPI requests. Typically this would be used on
This returns the file extension found on the URL. This is useful in allowing user-agents to override the default response content-type. For example, suffixing any URL with
.html can allow a
One situation where this is useful is to show, for debugging, an entry in its Atom format in a browser that doesn't support
This returns the derived response mime-type of the request. This is done by examining the HTTP
Accept header, and allowing the URL extensions to override it.
Returns the atom service as specified by the URL. This string is used as the service key which instantiates both the ServiceHandler and the StoreHandler. By default, the service is the first directory / folder specified after the
This returns an array of folders / files created from the request URL. This is typically used by the
ServiceHandler initialisation to extract entry or comment identifiers.
This returns the URI of the requested service, so without any entry or comment identifiers. This is used to create links to the service or resources within a service.
The Request object constructor which initialises the request object based on the received HTTP request.
This function is used to log debug or informational messages. This information is typically appended to a log file, or it can be echoed out as part of the response.