Webmaster  |  Imprint 
C++ Server Pages
Main  |  License  |  Documentation  |  Download 

HttpRequest Class Reference

HTTP-Request-message.

#include <tnt/httprequest.h>

Inheritance diagram for HttpRequest:

HttpMessage List of all members.

Public Types

typedef std::vector< std::string > args_type

Public Member Functions

 HttpRequest (Tntnet &application_, const SocketIf *socketIf=0)
 HttpRequest (Tntnet &application_, const std::string &url, const SocketIf *socketIf=0)
 HttpRequest (const HttpRequest &r)
HttpRequestoperator= (const HttpRequest &r)
void clear ()
 Removes all request-specific content.
const std::string & getBody () const
 returns the body of the message.
void setBody (const std::string &body_)
 sets the body of the message.
std::string getMethod () const
 Returns the http-method (normally GET or POST) of a request.
const char * getMethod_cstr () const
bool isMethodGET () const
bool isMethodPOST () const
bool isMethodHEAD () const
void setMethod (const char *method)
 sets the http-method of this request.
std::string getQuery () const
 returns url with get-parameters.
const std::string & getUrl () const
 returns the request-url without parameters.
const std::string & getQueryString () const
 returns get-parameters as string.
void setQueryString (const std::string &queryString_)
 sets query-string
void setPathInfo (const std::string &p)
const std::string & getPathInfo () const
void setArgs (const args_type &a)
const args_type & getArgs () const
args_type & getArgs ()
std::string getArgDef (args_type::size_type n, const std::string &def=std::string()) const
const std::string & getArg (args_type::size_type n) const
std::string getArg (const std::string &name, const std::string &def=std::string()) const
args_type::size_type getArgsCount () const
void parse (std::istream &in)
void doPostParse ()
tnt::QueryParams & getQueryParams ()
const tnt::QueryParams & getQueryParams () const
void setQueryParams (const tnt::QueryParams &q)
std::string getPeerIp () const
std::string getServerIp () const
bool isSsl () const
const ContenttypegetContentType () const
bool isMultipart () const
const MultipartgetMultipart () const
cxxtools::atomic_t getSerial () const
const std::locale & getLocale () const
const std::string & getLang () const
void setLocale (const std::locale &loc)
void setLang (const std::string &lang)
const Cookies & getCookies () const
bool hasCookie (const std::string &name) const
bool hasCookies () const
Cookie getCookie (const std::string &name) const
const Encoding & getEncoding () const
const char * getUserAgent () const
const char * getHost () const
const std::string & getUsername () const
const std::string & getPassword () const
bool verifyPassword (const std::string &password) const
bool keepAlive () const
bool acceptGzipEncoding () const
void setApplicationScope (Scope *s)
void setApplicationScope (Scope &s)
void setSessionScope (Sessionscope *s)
void setSessionScope (Sessionscope &s)
void clearSession ()
void setThreadContext (ThreadContext *ctx)
Scope & getRequestScope ()
Scope & getApplicationScope ()
Scope & getThreadScope ()
Sessionscope & getSessionScope ()
bool hasSessionScope () const
size_t getContentSize () const
 returns the value of the content-size-header as read from the client.
std::string getVirtualHost () const
 returns the virtual-host-header of this request.
TntnetgetApplication ()
void touch ()
 rewind watchdog timer.

Static Public Member Functions

static void setMaxRequestSize (size_t s)
 Sets a limit for a maximum request size.
static size_t getMaxRequestSize ()

Friends

class Parser
class SessionUnlocker
class ApplicationUnlocker

Classes

class  Parser
Copyright © 2008 The Tntnet Development Team
Tntnet 1.6