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

HttpReply Class Reference

HTTP-Reply-message.

#include <tnt/httpreply.h>

Inheritance diagram for HttpReply:

HttpMessage List of all members.

Public Member Functions

 HttpReply (std::ostream &s, bool sendStatusLine=true)
void setContentType (const char *t)
void setContentType (const std::string &t)
const char * getContentType () const
void setHeadRequest (bool sw=true)
unsigned redirect (const std::string &newLocation)
 Throws an exception, which results in a redirect.
unsigned notAuthorized (const std::string &realm)
 Throws an exception, which results in a login dialog in the browser.
unsigned notAuthorised (const std::string &realm)
 alias for notAuthorized
void sendReply (unsigned ret, const char *msg="OK")
void sendReply (unsigned ret, const std::string &msg)
std::ostream & out ()
 returns outputstream
std::ostream & sout ()
 returns safe outputstream (unsafe html-chars are escaped)
std::ostream & uout ()
 returns outputstream, which url encodes output
void resetContent ()
void setContentLengthHeader (size_t size)
void setKeepAliveHeader ()
virtual void setDirectMode (unsigned ret=HTTP_OK, const char *msg="OK")
virtual void setDirectModeNoFlush ()
virtual bool isDirectMode () const
std::string::size_type getContentSize () const
std::ostream & getDirectStream ()
void setMd5Sum ()
void setCookie (const std::string &name, const Cookie &value)
void setCookie (const std::string &name, const std::string &value, unsigned seconds)
void setCookies (const Cookies &c)
void clearCookie (const std::string &name)
void clearCookie (const std::string &name, const Cookie &c)
bool hasCookies () const
const Cookies & getCookies () const
void setKeepAliveCounter (unsigned c)
unsigned getKeepAliveCounter () const
void setAcceptEncoding (const Encoding &enc)
bool keepAlive () const
void setLocale (const std::locale &loc)

Static Public Member Functions

static bool tryCompress (std::string &body)
static void setKeepAliveTimeout (unsigned ms)
static unsigned getKeepAliveTimeout ()
static void setMinCompressSize (unsigned s)
static unsigned getMinCompressSize ()
static void setDefaultContentType (const std::string &ct)
static const std::string & getDefaultContentType ()

Friends

class Savepoint
Copyright © 2008 The Tntnet Development Team
Tntnet 1.6