ACE_INet 8.0.1
Loading...
Searching...
No Matches
Public Member Functions | Static Public Attributes | Private Types | Private Attributes | List of all members
ACE::HTTP::Request Class Reference

#include <HTTP_Request.h>

Inheritance diagram for ACE::HTTP::Request:
Inheritance graph
[legend]
Collaboration diagram for ACE::HTTP::Request:
Collaboration graph
[legend]

Public Member Functions

 Request ()
 Constructor; creates a GET / HTTP/1.0 HTTP request.
 
 Request (const ACE_CString &version)
 Constructor; creates a GET request with given version.
 
 Request (const ACE_CString &method, const ACE_CString &uri)
 Constructor; creates a HTTP/1.0 request with given method and URI.
 
 Request (const ACE_CString &method, const ACE_CString &uri, const ACE_CString &version)
 Constructor; creates an HTTP request with given method, URI and version.
 
virtual ~Request ()
 Destructor.
 
void reset ()
 Reset the request object.
 
void reset (const ACE_CString &version)
 
void reset (const ACE_CString &method, const ACE_CString &uri)
 
void reset (const ACE_CString &method, const ACE_CString &uri, const ACE_CString &version)
 
void set_method (const ACE_CString &method)
 Set the method.
 
const ACE_CStringget_method () const
 Return the method.
 
void set_URI (const ACE_CString &uri)
 Set the request URI.
 
const ACE_CStringget_URI () const
 Return the request URI.
 
void set_host (const ACE_CString &host)
 Set the Host header field.
 
void set_host (const ACE_CString &host, u_short port)
 
bool has_host () const
 Returns true if Host header field has been set.
 
ACE_CString get_host () const
 Returns the value of the Host header field.
 
void add_cookie (const ACE_CString &cookie)
 Adds a Cookie header.
 
void get_cookies (ACE_Array< ACE_CString > &cookies) const
 Get cookies from Cookie header(s).
 
bool has_credentials () const
 
void get_credentials (ACE_CString &scheme, ACE_CString &auth_info) const
 Returns the authentication scheme and authentication information.
 
void set_credentials (const ACE_CString &scheme, const ACE_CString &auth_info)
 Set the authentication scheme and information.
 
void write (std::ostream &str) const
 Writes the HTTP request to the given stream.
 
bool read (std::istream &str)
 
- Public Member Functions inherited from ACE::INet::Request
 Request ()
 
- Public Member Functions inherited from ACE::HTTP::Header
 Header ()
 Constructor.
 
 Header (const ACE_CString &version)
 Constructor.
 
virtual ~Header ()
 Destructor.
 
void set_version (const ACE_CString &version)
 Sets the HTTP version to use.
 
const ACE_CStringget_version () const
 Returns the HTTP version.
 
void set_chunked_transfer_encoding (bool flag)
 
bool has_chunked_transfer_encoding () const
 
void set_keep_alive (bool keep_alive)
 
bool has_keep_alive () const
 
- Public Member Functions inherited from ACE::INet::HeaderBase
 HeaderBase ()
 Constructor.
 
virtual ~HeaderBase ()
 Destructor.
 
virtual void set_content_length (int length)
 
virtual int get_content_length () const
 
virtual void set_content_type (const ACE_CString &mime_type)
 
virtual ACE_CString get_content_type () const
 
void clear ()
 
void set (const ACE_CString &name, const ACE_CString &value)
 Sets header name to value. Overwrites existing vaues.
 
void add (const ACE_CString &name, const ACE_CString &value)
 Adds header name with value. Allows duplicates.
 
void remove (const ACE_CString &name)
 Removes header name (first found).
 
bool get (const ACE_CString &name, ACE_CString &value) const
 Retrieves value for header name into value (first found).
 
bool has (const ACE_CString &name) const
 Returns true if a header name exists (1 or more), false otherwise.
 
void get_values (const ACE_CString &name, ACE_Array< ACE_CString > &values) const
 Retrieves values for all headers name into values.
 

Static Public Attributes

static const ACE_CString HTTP_GET = "GET"
 
static const ACE_CString HTTP_HEAD = "HEAD"
 
static const ACE_CString HTTP_PUT = "PUT"
 
static const ACE_CString HTTP_POST = "POST"
 
static const ACE_CString HTTP_OPTIONS = "OPTIONS"
 
static const ACE_CString HTTP_DELETE = "DELETE"
 
static const ACE_CString HTTP_TRACE = "TRACE"
 
static const ACE_CString HTTP_CONNECT = "CONNECT"
 
static const ACE_CString HOST = "Host"
 
static const ACE_CString COOKIE = "Cookie"
 
static const ACE_CString AUTHORIZATION = "Authorization"
 
- Static Public Attributes inherited from ACE::HTTP::Header
static const ACE_CString HTTP_1_0 = "HTTP/1.0"
 
static const ACE_CString HTTP_1_1 = "HTTP/1.1"
 
static const ACE_CString CHUNKED_TRANSFER_ENCODING = "chunked"
 
static const ACE_CString TRANSFER_ENCODING = "Transfer-Encoding"
 
static const ACE_CString CONNECTION = "Connection"
 
static const ACE_CString CONNECTION_KEEP_ALIVE = "Keep-Alive"
 
static const ACE_CString CONNECTION_CLOSE = "Close"
 
- Static Public Attributes inherited from ACE::INet::HeaderBase
static const int UNKNOWN_CONTENT_LENGTH = -1
 
static const ACE_CString UNKNOWN_CONTENT_TYPE
 
static const ACE_CString CONTENT_LENGTH = "Content-Length"
 
static const ACE_CString CONTENT_TYPE = "Content-Type"
 
static const ACE_CString EMPTY
 

Private Types

enum  Limits { MAX_METHOD_LENGTH = 32 , MAX_URI_LENGTH = 4096 , MAX_VERSION_LENGTH = 8 }
 

Private Attributes

ACE_CString method_
 
ACE_CString uri_
 

Additional Inherited Members

- Protected Member Functions inherited from ACE::INet::HeaderBase
int read_field (std::istream &str, ACE_CString &var, size_t maxlen, char delim)
 
int read_ws_field (std::istream &str, ACE_CString &var, size_t maxlen)
 
- Static Protected Attributes inherited from ACE::INet::HeaderBase
static const int eof_ = std::char_traits<char>::eof()
 

Member Enumeration Documentation

◆ Limits

Enumerator
MAX_METHOD_LENGTH 
MAX_URI_LENGTH 
MAX_VERSION_LENGTH 

Constructor & Destructor Documentation

◆ Request() [1/4]

ACE::HTTP::Request::Request ( )

Constructor; creates a GET / HTTP/1.0 HTTP request.

◆ Request() [2/4]

ACE::HTTP::Request::Request ( const ACE_CString & version)

Constructor; creates a GET request with given version.

◆ Request() [3/4]

ACE::HTTP::Request::Request ( const ACE_CString & method,
const ACE_CString & uri )

Constructor; creates a HTTP/1.0 request with given method and URI.

◆ Request() [4/4]

ACE::HTTP::Request::Request ( const ACE_CString & method,
const ACE_CString & uri,
const ACE_CString & version )

Constructor; creates an HTTP request with given method, URI and version.

◆ ~Request()

ACE::HTTP::Request::~Request ( )
virtual

Destructor.

Reimplemented from ACE::INet::Request.

Member Function Documentation

◆ add_cookie()

void ACE::HTTP::Request::add_cookie ( const ACE_CString & cookie)

Adds a Cookie header.

◆ get_cookies()

void ACE::HTTP::Request::get_cookies ( ACE_Array< ACE_CString > & cookies) const

Get cookies from Cookie header(s).

◆ get_credentials()

void ACE::HTTP::Request::get_credentials ( ACE_CString & scheme,
ACE_CString & auth_info ) const

Returns the authentication scheme and authentication information.

◆ get_host()

ACE_CString ACE::HTTP::Request::get_host ( ) const
inline

Returns the value of the Host header field.

◆ get_method()

const ACE_CString & ACE::HTTP::Request::get_method ( ) const
inline

Return the method.

◆ get_URI()

const ACE_CString & ACE::HTTP::Request::get_URI ( ) const
inline

Return the request URI.

◆ has_credentials()

bool ACE::HTTP::Request::has_credentials ( ) const
inline

Returns true if the request contains authentication information in the form of an Authorization header.

◆ has_host()

bool ACE::HTTP::Request::has_host ( ) const
inline

Returns true if Host header field has been set.

◆ read()

bool ACE::HTTP::Request::read ( std::istream & str)
virtual

Reads the HTTP request from the given stream.

Reimplemented from ACE::INet::HeaderBase.

◆ reset() [1/4]

void ACE::HTTP::Request::reset ( )
inline

Reset the request object.

◆ reset() [2/4]

void ACE::HTTP::Request::reset ( const ACE_CString & method,
const ACE_CString & uri )
inline

◆ reset() [3/4]

void ACE::HTTP::Request::reset ( const ACE_CString & method,
const ACE_CString & uri,
const ACE_CString & version )
inline

◆ reset() [4/4]

void ACE::HTTP::Request::reset ( const ACE_CString & version)
inline

◆ set_credentials()

void ACE::HTTP::Request::set_credentials ( const ACE_CString & scheme,
const ACE_CString & auth_info )

Set the authentication scheme and information.

◆ set_host() [1/2]

void ACE::HTTP::Request::set_host ( const ACE_CString & host)
inline

Set the Host header field.

◆ set_host() [2/2]

void ACE::HTTP::Request::set_host ( const ACE_CString & host,
u_short port )

◆ set_method()

void ACE::HTTP::Request::set_method ( const ACE_CString & method)
inline

Set the method.

◆ set_URI()

void ACE::HTTP::Request::set_URI ( const ACE_CString & uri)
inline

Set the request URI.

◆ write()

void ACE::HTTP::Request::write ( std::ostream & str) const
virtual

Writes the HTTP request to the given stream.

Reimplemented from ACE::INet::HeaderBase.

Member Data Documentation

◆ AUTHORIZATION

const ACE_CString ACE::HTTP::Request::AUTHORIZATION = "Authorization"
static

◆ COOKIE

const ACE_CString ACE::HTTP::Request::COOKIE = "Cookie"
static

◆ HOST

const ACE_CString ACE::HTTP::Request::HOST = "Host"
static

◆ HTTP_CONNECT

const ACE_CString ACE::HTTP::Request::HTTP_CONNECT = "CONNECT"
static

◆ HTTP_DELETE

const ACE_CString ACE::HTTP::Request::HTTP_DELETE = "DELETE"
static

◆ HTTP_GET

const ACE_CString ACE::HTTP::Request::HTTP_GET = "GET"
static

◆ HTTP_HEAD

const ACE_CString ACE::HTTP::Request::HTTP_HEAD = "HEAD"
static

◆ HTTP_OPTIONS

const ACE_CString ACE::HTTP::Request::HTTP_OPTIONS = "OPTIONS"
static

◆ HTTP_POST

const ACE_CString ACE::HTTP::Request::HTTP_POST = "POST"
static

◆ HTTP_PUT

const ACE_CString ACE::HTTP::Request::HTTP_PUT = "PUT"
static

◆ HTTP_TRACE

const ACE_CString ACE::HTTP::Request::HTTP_TRACE = "TRACE"
static

◆ method_

ACE_CString ACE::HTTP::Request::method_
private

◆ uri_

ACE_CString ACE::HTTP::Request::uri_
private

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