Reply Class Reference

#include <Pt/Http/Reply.h>

HTTP reply message.

Inherits Message.

Public Types

enum  StatusCode {
  Continue = 100,
  OK = 200,
  MultipleChoices = 300,
  BadRequest = 400,
  Unauthorized = 401,
  RequestEntityTooLarge = 413,
  InternalServerError = 500
}
 HTTP reply status code. More...
 

Public Member Functions

 Reply (Http::Connection &conn)
 Construct with connection.
 
void beginSend (bool finish=true)
 Begin sending the reply.
 
std::iostream & body ()
 Returns the body of the message.
 
void clear ()
 Clears all content.
 
void discard ()
 Discards the message body.
 
MessageHeaderheader ()
 Returns the header of the message.
 
const MessageHeaderheader () const
 Returns the header of the message.
 
void setStatus (unsigned code, const std::string &txt)
 Sets the HTTP status.
 
void setStatus (unsigned code, const char *txt)
 Sets the HTTP status.
 
unsigned statusCode () const
 Returns the HTTP status code.
 
const std::string & statusText () const
 Returns the HTTP status text.
 

Member Enumeration Documentation

enum StatusCode
Enumerator
Continue 

Continue.

OK 

OK.

MultipleChoices 

Multiple choices for request.

BadRequest 

Bad request received.

Unauthorized 

Unauthorized access.

RequestEntityTooLarge 

Request entity too large

InternalServerError 

Internal server error occured.