Interface to HTTP requests. More...
#include <xmltooling/io/HTTPRequest.h>
Public Member Functions | |
bool | isSecure () const |
Returns true iff the request is over a confidential channel. | |
bool | isDefaultPort () const |
Returns true iff the request port is the default port for the request protocol. | |
std::string | getLanguageRange () const |
Returns a language range to use in selecting language-specific content for this request. | |
virtual const char * | getMethod () const =0 |
Returns the HTTP method of the request (GET, POST, etc. | |
virtual const char * | getRequestURI () const =0 |
Returns the request URI. | |
virtual const char * | getRequestURL () const =0 |
Returns the complete request URL, including scheme, host, port, and URI. | |
virtual const char * | getQueryString () const =0 |
Returns the HTTP query string appened to the request. | |
virtual std::string | getHeader (const char *name) const =0 |
Returns a request header value. | |
virtual const char * | getCookie (const char *name) const |
Get a cookie value supplied by the client. | |
virtual const std::map < std::string, std::string > & | getCookies () const |
Gets all the cookies supplied by the client. |
Interface to HTTP requests.
To supply information from the surrounding web server environment, a shim must be supplied in the form of this interface to adapt the library to different proprietary server APIs.
This interface need not be threadsafe.
virtual const char* xmltooling::HTTPRequest::getCookie | ( | const char * | name | ) | const [virtual] |
Get a cookie value supplied by the client.
name | name of cookie |
virtual const std::map<std::string,std::string>& xmltooling::HTTPRequest::getCookies | ( | ) | const [virtual] |
Gets all the cookies supplied by the client.
virtual std::string xmltooling::HTTPRequest::getHeader | ( | const char * | name | ) | const [pure virtual] |
Returns a request header value.
name | the name of the header to return |
std::string xmltooling::HTTPRequest::getLanguageRange | ( | ) | const [virtual] |
Returns a language range to use in selecting language-specific content for this request.
The syntax is that of the HTTP 1.1 Accept-Language header, even if the underlying request is not HTTP.
Reimplemented from xmltooling::GenericRequest.
virtual const char* xmltooling::HTTPRequest::getMethod | ( | ) | const [pure virtual] |
Returns the HTTP method of the request (GET, POST, etc.
)
virtual const char* xmltooling::HTTPRequest::getQueryString | ( | ) | const [pure virtual] |
Returns the HTTP query string appened to the request.
The query string is returned without any decoding applied, everything found after the ? delimiter.
virtual const char* xmltooling::HTTPRequest::getRequestURI | ( | ) | const [pure virtual] |
Returns the request URI.
virtual const char* xmltooling::HTTPRequest::getRequestURL | ( | ) | const [pure virtual] |
Returns the complete request URL, including scheme, host, port, and URI.
bool xmltooling::HTTPRequest::isDefaultPort | ( | ) | const [virtual] |
Returns true iff the request port is the default port for the request protocol.
Reimplemented from xmltooling::GenericRequest.
bool xmltooling::HTTPRequest::isSecure | ( | ) | const [virtual] |
Returns true iff the request is over a confidential channel.
Implements xmltooling::GenericRequest.