libutil++  1.9.3
 All Classes Functions Variables
Public Types | Public Member Functions | Static Public Attributes | Protected Member Functions | Friends | List of all members
sella::server::HTTPRequest Class Reference

#include <HTTPRequest.h>

Public Types

enum  Method {
  None, Options, Get, Head,
  Post, Put, Delete, Trace,
  Connect, Patch, Extension
}
 
enum  AcceptType {
  HTML, Plain, JSON, JSONP,
  XML, XHTML_XML, CSV, PNG,
  GIF, JPEG, Icon, Any,
  Text_Any, Text, Application_Any, Application,
  Image_Any, Image, Audio_Any, Audio,
  Other
}
 

Public Member Functions

 HTTPRequest (const HTTP &http) throw ()
 
void parse (const std::string &buffer) throw (ServerException)
 
void appendBody (const std::string &data) throw (ServerException)
 
void appendBody (const std::vector< char > &data) throw (ServerException)
 
Method getMethod (bool useOverride=true) const throw ()
 
const std::string & getMethodRaw (bool useOverride=true) const throw ()
 
Method getMethodOverride (void) const throw ()
 
const std::string & getMethodOverrideRaw (void) const throw ()
 
const std::string & getURI (void) const throw ()
 
const std::string & getPath (void) const throw ()
 
const std::string & getExtension (void) const throw ()
 
const std::string & getQuery (void) const throw ()
 
const std::string & getVersion (void) const throw ()
 
const std::string & getHost (void) const throw ()
 
const std::string & getUserAgent (void) const throw ()
 
const std::string & getAuthorization (void) const throw ()
 
bool getAuthorizationCredentials (std::string &username, std::string &password) const throw ()
 
const std::vector< std::string > & getAccept (void) const throw ()
 
AcceptType getAcceptType (AcceptType fallback=Other) const throw ()
 
const std::vector< std::string > & getHeaders () const throw ()
 
std::string getHeader (const std::string &header) const throw (ServerException)
 
const std::string getBody (void) const throw ()
 
const std::vector< char > & getContent (void) const throw ()
 
bool isContinue (void) const throw ()
 
bool isChunked (void) const throw ()
 
bool isAcceptGzip (void) const throw ()
 
bool isAcceptDeflate (void) const throw ()
 
bool isBasicAuthorization (void) const throw ()
 
bool hasHeader (const std::string &header) const throw (ServerException)
 
bool empty (void) const throw ()
 
void clear (void) throw ()
 
std::string str (void) const throw ()
 
void print (void) const throw ()
 

Static Public Attributes

static const std::string ContentTypeDefault = "application/octet-stream"
 

Protected Member Functions

std::string getFullpath (const std::string &file=std::string()) throw (ServerException)
 
std::string getMIMEType (const std::string &file, const std::string &fallback=std::string()) const throw (ServerException)
 
std::string getMIMEType (const std::string &buffer, size_t size, const std::string &fallback=std::string()) const throw (ServerException)
 
bool isDirectory (const std::string &path) const throw ()
 
bool isFile (const std::string &file) const throw ()
 
void magic_open (magic_t &magic) const throw (ServerException)
 
void magic_close (magic_t &magic) const throw ()
 

Friends

class HTTPConnection
 

Detailed Description

Provides the incoming request and related functions.

Definition at line 31 of file HTTPRequest.h.


The documentation for this class was generated from the following files: