Public Member Functions | Friends

Wt::Http::Request Class Reference

An HTTP request. More...

#include <Wt/Http/Request>

List of all members.

Public Member Functions

const ParameterMapgetParameterMap () const
 Returns the query parameters.
const UploadedFileMapuploadedFiles () const
 Returns uploaded file parameters.
const ParameterValuesgetParameterValues (const std::string &name) const
 Returns all values for a query parameter.
const std::string * getParameter (const std::string &name) const
 Returns a query parameter value.
const UploadedFilegetUploadedFile (const std::string &name) const
 Returns an uploaded file.
int tooLarge () const
 Returns a non-zero value that exceeded the maximum allowed request.
ResponseContinuationcontinuation () const
 Returns a continuation object.
std::string serverName () const
 Returns the (public) server name.
std::string serverPort () const
 Returns the server port.
std::string path () const
 Returns the request path.
std::string pathInfo () const
 Returns the request path info.
std::string queryString () const
 Returns the request query string.
std::string urlScheme () const
 Returns the url scheme used.
std::istream & in () const
 Returns the input stream for parsing the body.
std::string contentType () const
 Returns the "Content Type" of the request body.
int contentLength () const
 Returns the "Content Length" of the request body.
std::string userAgent () const
 Returns the user agent.
std::string clientAddress () const
 Returns the IP address of the client.
std::string method () const
 Returns the request method.

Friends

class Wt::WResource

Detailed Description

An HTTP request.

The request provides information of parameters, including uploaded files, that were present in a GET or POST request.

See also:
WResource::handleRequest()

Member Function Documentation

std::string Wt::Http::Request::clientAddress (  ) const

Returns the IP address of the client.

The (most likely) IP address of the client that is connected to this session.

This is taken to be the first public address that is given in the Client-IP header, or in the X-Forwarded-For header (in case the client is behind a proxy). If none of these headers is present, the remote socket IP address is used.

int Wt::Http::Request::contentLength (  ) const

Returns the "Content Length" of the request body.

See also:
in()
std::string Wt::Http::Request::contentType (  ) const

Returns the "Content Type" of the request body.

See also:
in()
ResponseContinuation* Wt::Http::Request::continuation (  ) const [inline]

Returns a continuation object.

Returns a non-zero continuation object if the request is a continuation request for an earlier response for which a continuation was created.

See also:
Response::createContinuation()
const std::string * Wt::Http::Request::getParameter ( const std::string &  name ) const

Returns a query parameter value.

Returns the first value defined for a parameter named name or 0 if the paramter does not exist.

const ParameterMap& Wt::Http::Request::getParameterMap (  ) const [inline]

Returns the query parameters.

Returns parameters that were passed to the query, either inside the URL, or inside a POST request, excluding uploaded files.

See also:
uploadedFiles()
const ParameterValues & Wt::Http::Request::getParameterValues ( const std::string &  name ) const

Returns all values for a query parameter.

Returns all values defined for a parameter named name. A single parameter may have multiple values, e.g. in the query string '?param=value1&param=value2'.

Returns an empty list if the query parameter does not exist.

const UploadedFile * Wt::Http::Request::getUploadedFile ( const std::string &  name ) const

Returns an uploaded file.

Returns the file uploaded for a parameter named name or 0 if the parameter does not contain does not exist or was not associated with a file input field.

std::istream & Wt::Http::Request::in (  ) const

Returns the input stream for parsing the body.

If the request was a POST with as contentType() "application/x-www-form-urlencoded" or "multipart/form-data", the input stream will already have been consumed by Wt's CGI parser, and made available as parameters in the request.

std::string Wt::Http::Request::method (  ) const

Returns the request method.

Returns the HTTP request method ("GET", "POST", or other).

std::string Wt::Http::Request::path (  ) const

Returns the request path.

Returns the path at which this request was received (excluding internal path information): it is the path at which the application or resource is deployed.

See also:
pathInfo()
std::string Wt::Http::Request::pathInfo (  ) const

Returns the request path info.

Returns additional path information internal to the path().

See also:
pathInfo()
std::string Wt::Http::Request::serverName (  ) const

Returns the (public) server name.

Returns the public server name. This is the server name that is advertised to outside, which is determined in a OS specific way.

See also:
serverPort()
std::string Wt::Http::Request::serverPort (  ) const

Returns the server port.

Returns the server port number through which this request was received.

See also:
serverName()
int Wt::Http::Request::tooLarge (  ) const

Returns a non-zero value that exceeded the maximum allowed request.

See also:
WApplication::requestTooLarge
const UploadedFileMap& Wt::Http::Request::uploadedFiles (  ) const [inline]

Returns uploaded file parameters.

See also:
getParameterMap()
std::string Wt::Http::Request::urlScheme (  ) const

Returns the url scheme used.

This is either "http" or "https"

std::string Wt::Http::Request::userAgent (  ) const

Returns the user agent.

The user agent, as reported in the HTTP User-Agent field.


Generated on Sat Dec 4 2010 06:32:36 for Wt by doxygen 1.7.2