ACE_INet
6.1.8
|
#include <HTTP_Request.h>
Public Member Functions | |
Request () | |
Constructor; creates a GET / HTTP/1.0 HTTP request. More... | |
Request (const ACE_CString &version) | |
Constructor; creates a GET request with given version. More... | |
Request (const ACE_CString &method, const ACE_CString &uri) | |
Constructor; creates a HTTP/1.0 request with given method and URI. More... | |
Request (const ACE_CString &method, const ACE_CString &uri, const ACE_CString &version) | |
Constructor; creates an HTTP request with given method, URI and version. More... | |
virtual | ~Request () |
Destructor. More... | |
void | reset () |
Reset the request object. More... | |
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. More... | |
const ACE_CString & | get_method () const |
Return the method. More... | |
void | set_URI (const ACE_CString &uri) |
Set the request URI. More... | |
const ACE_CString & | get_URI () const |
Return the request URI. More... | |
void | set_host (const ACE_CString &host) |
Set the Host header field. More... | |
void | set_host (const ACE_CString &host, u_short port) |
bool | has_host () const |
Returns true if Host header field has been set. More... | |
ACE_CString | get_host () const |
Returns the value of the Host header field. More... | |
void | add_cookie (const ACE_CString &cookie) |
Adds a Cookie header. More... | |
void | get_cookies (ACE_Array< ACE_CString > &cookies) const |
Get cookies from Cookie header(s). More... | |
bool | has_credentials () const |
void | get_credentials (ACE_CString &scheme, ACE_CString &auth_info) const |
Returns the authentication scheme and authentication information. More... | |
void | set_credentials (const ACE_CString &scheme, const ACE_CString &auth_info) |
Set the authentication scheme and information. More... | |
void | write (std::ostream &str) const |
Writes the HTTP request to the given stream. More... | |
bool | read (std::istream &str) |
![]() | |
Request () | |
![]() | |
Header () | |
Constructor. More... | |
Header (const ACE_CString &version) | |
Constructor. More... | |
virtual | ~Header () |
Destructor. More... | |
void | set_version (const ACE_CString &version) |
Sets the HTTP version to use. More... | |
const ACE_CString & | get_version () const |
Returns the HTTP version. More... | |
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 |
![]() | |
HeaderBase () | |
Constructor. More... | |
virtual | ~HeaderBase () |
Destructor. More... | |
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 . Overwrites existing vaues. More... | |
void | add (const ACE_CString &name, const ACE_CString &value) |
Adds header <name> with . Allows duplicates. More... | |
void | remove (const ACE_CString &name) |
Removes header <name> (first found). More... | |
bool | get (const ACE_CString &name, ACE_CString &value) const |
Retrieves value for header <name> into (first found). More... | |
bool | has (const ACE_CString &name) const |
Returns true if a header <name> exists (1 or more), false otherwise. More... | |
void | get_values (const ACE_CString &name, ACE_Array< ACE_CString > &values) const |
Retrieves values for all headers <name> into <values>. More... | |
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 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 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 | |
![]() | |
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 const int | eof_ = std::char_traits<char>::eof() |
|
private |
ACE::HTTP::Request::Request | ( | ) |
Constructor; creates a GET / HTTP/1.0 HTTP request.
ACE::HTTP::Request::Request | ( | const ACE_CString & | version | ) |
Constructor; creates a GET request with given version.
ACE::HTTP::Request::Request | ( | const ACE_CString & | method, |
const ACE_CString & | uri | ||
) |
Constructor; creates a HTTP/1.0 request with given method and URI.
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.
|
virtual |
Destructor.
Reimplemented from ACE::INet::Request.
void ACE::HTTP::Request::add_cookie | ( | const ACE_CString & | cookie | ) |
Adds a Cookie header.
void ACE::HTTP::Request::get_cookies | ( | ACE_Array< ACE_CString > & | cookies | ) | const |
Get cookies from Cookie header(s).
void ACE::HTTP::Request::get_credentials | ( | ACE_CString & | scheme, |
ACE_CString & | auth_info | ||
) | const |
Returns the authentication scheme and authentication information.
|
inline |
Returns the value of the Host header field.
|
inline |
Return the method.
|
inline |
Return the request URI.
|
inline |
Returns true if the request contains authentication information in the form of an Authorization header.
|
inline |
Returns true if Host header field has been set.
|
virtual |
Reads the HTTP request from the given stream.
Reimplemented from ACE::INet::HeaderBase.
|
inline |
Reset the request object.
|
inline |
|
inline |
|
inline |
void ACE::HTTP::Request::set_credentials | ( | const ACE_CString & | scheme, |
const ACE_CString & | auth_info | ||
) |
Set the authentication scheme and information.
|
inline |
Set the Host header field.
void ACE::HTTP::Request::set_host | ( | const ACE_CString & | host, |
u_short | port | ||
) |
|
inline |
Set the method.
|
inline |
Set the request URI.
|
virtual |
Writes the HTTP request to the given stream.
Reimplemented from ACE::INet::HeaderBase.
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
private |
|
private |