Contains information required to configure and perform a HTTP request.
Unique requests can be queued for async processing with CYIHTTPService. Request objects should be retained if cancellation is required.
#include <network/YiHTTPRequest.h>

Public Types | |
| enum | METHOD { GET, PUT, POST, DELETE } |
| Supported HTTP request methods. More... | |
| enum | COMPRESSION_TYPE { UNCOMPRESSED, GZIP } |
| Provides a hint to the server if compression can be used on the response data. More... | |
Public Member Functions | |
| CYIHTTPRequest () | |
| CYIHTTPRequest (const CYIUrl &url, CYIHTTPRequest::METHOD eMethod) | |
| CYIHTTPRequest (const CYIServer &server) | |
| CYIHTTPRequest (const CYIServer &server, const CYIUrl &url, CYIHTTPRequest::METHOD eMethod) | |
| virtual | ~CYIHTTPRequest () |
| void | SetMethod (CYIHTTPRequest::METHOD eMethod) |
| void | SetServer (const CYIServer &server) |
| void | SetPostData (const CYIString &postData) |
| const std::vector< char > & | GetPostData () const |
| void | AddHeader (const CYIString &header) |
| const std::vector< CYIString > & | GetHeaders () const |
| uint64_t | GetUniqueID () const |
| uint32_t | GetID () const |
| void | SetID (uint32_t uRequestID) |
| void | SetContextID (uint32_t uContextID) |
| uint32_t | GetContextID () const |
| void | SetCompressionType (COMPRESSION_TYPE eCompressionType) |
| CYIHTTPRequest::COMPRESSION_TYPE | GetCompressionType () const |
| METHOD | GetMethod () const |
| void | SetURL (const CYIUrl &url) |
| const CYIUrl & | GetURL () const |
| const CYIServer | GetServer () const |
| void | SetNetworkTimeoutMs (uint32_t uNetworkTimeoutMs) |
| uint32_t | GetNetworkTimeoutMs () const |
| void | SetConnectionTimeoutMs (uint32_t uConnectionTimeoutMs) |
| uint32_t | GetConnectionTimeoutMs () const |
| void | SetOpaqueCleanupObject (OpaqueCleanup *pCleanup) |
| void | SetIsConnectivityProbe (bool bIsConnectivityProbe) |
| bool | IsConnectivityProbe () const |
| void | SetUseCookies (bool bUseCookies) |
| bool | IsUsingCookies () const |
| void * | GetPriv () const |
| bool | operator== (const CYIHTTPRequest &other) const |
| bool | operator!= (const CYIHTTPRequest &other) const |
Public Member Functions inherited from CYIScriptableObject | |
| CYIScriptableObject () | |
| CYIScriptableObject (const CYIScriptableObject &other) | |
| CYIScriptableObject & | operator= (const CYIScriptableObject &other) |
| virtual | ~CYIScriptableObject () |
| CYIBindingImplementation * | GetBindingImplementation () const |
| void | SetBindingImplementation (CYIBindingImplementation *pBindingImplementation) |
| virtual const CYIRuntimeTypeInfo * | GetRuntimeTypeInfoForScriptObject () const |
Public Attributes | |
| CYISignal< const std::shared_ptr< CYIHTTPRequest > &, const std::shared_ptr< CYIHTTPResponse > &, bool > | NotifyResponse |
| Emitted when a response has been received for this request. The bool parameter will be true if the response is a cached response and false if the response is a server response. More... | |
| CYISignal< const std::shared_ptr< CYIHTTPRequest > &, const HTTP_STATUS_CODE, const CYIString & > | NotifyError |
| Emitted when an error occured processing this request, and no response is available. Parameters included are the status code (which may be from the server or locally generated if an error occured during processing) and an error string. More... | |
| CYISignal< const std::shared_ptr< CYIHTTPRequest > &, const std::shared_ptr< CYIHTTPResponse > &, const HTTP_STATUS_CODE > | NotifyComplete |
| Emitted when a success or failure response is received, or no response is available. Parameters included are request, response and status code. More... | |
Provides a hint to the server if compression can be used on the response data.
Supported HTTP request methods.
| CYIHTTPRequest::CYIHTTPRequest | ( | ) |
| CYIHTTPRequest::CYIHTTPRequest | ( | const CYIUrl & | url, |
| CYIHTTPRequest::METHOD | eMethod | ||
| ) |
| CYIHTTPRequest::CYIHTTPRequest | ( | const CYIServer & | server | ) |
| CYIHTTPRequest::CYIHTTPRequest | ( | const CYIServer & | server, |
| const CYIUrl & | url, | ||
| CYIHTTPRequest::METHOD | eMethod | ||
| ) |
|
virtual |
| void CYIHTTPRequest::AddHeader | ( | const CYIString & | header | ) |
Adds a header to the request. A header consists of a field name followed by a colon and the field value.
| CYIHTTPRequest::COMPRESSION_TYPE CYIHTTPRequest::GetCompressionType | ( | ) | const |
Returns the current compression type for the request.
| uint32_t CYIHTTPRequest::GetConnectionTimeoutMs | ( | ) | const |
| uint32_t CYIHTTPRequest::GetContextID | ( | ) | const |
Returns the request context ID.
| const std::vector<CYIString>& CYIHTTPRequest::GetHeaders | ( | ) | const |
Returns the headers currently attached to the request.
| uint32_t CYIHTTPRequest::GetID | ( | ) | const |
Returns the user request ID.
| METHOD CYIHTTPRequest::GetMethod | ( | ) | const |
Returns the current method.
| uint32_t CYIHTTPRequest::GetNetworkTimeoutMs | ( | ) | const |
| const std::vector<char>& CYIHTTPRequest::GetPostData | ( | ) | const |
Returns the POST data attached to this request.
| void* CYIHTTPRequest::GetPriv | ( | ) | const |
Returns a raw pointer to the internal private implementation.
For internal use only.
| const CYIServer CYIHTTPRequest::GetServer | ( | ) | const |
Returns the server for the request.
| uint64_t CYIHTTPRequest::GetUniqueID | ( | ) | const |
Returns the unique request ID.
| const CYIUrl& CYIHTTPRequest::GetURL | ( | ) | const |
Returns the full URL for the request.
| bool CYIHTTPRequest::IsConnectivityProbe | ( | ) | const |
Query if the request will be used for connectivity probing.
For interal use by YiConnectivity.
| bool CYIHTTPRequest::IsUsingCookies | ( | ) | const |
Returns whether the request will include cookies from the cookie store.
| bool CYIHTTPRequest::operator!= | ( | const CYIHTTPRequest & | other | ) | const |
| bool CYIHTTPRequest::operator== | ( | const CYIHTTPRequest & | other | ) | const |
Compares two requests by their request IDs.
| void CYIHTTPRequest::SetCompressionType | ( | COMPRESSION_TYPE | eCompressionType | ) |
Sets the allowed compression type for the request.
| void CYIHTTPRequest::SetConnectionTimeoutMs | ( | uint32_t | uConnectionTimeoutMs | ) |
Sets the maximum amount of time, in milliseconds, which the connection phase for a request may take. This is the time from when the request is dequeued and the transfer has started to when a response is received from the server.
| void CYIHTTPRequest::SetContextID | ( | uint32_t | uContextID | ) |
Sets a context ID, usable by client to identify an individual request.
| void CYIHTTPRequest::SetID | ( | uint32_t | uRequestID | ) |
Sets the user request ID. User request IDs are 0 by default.
| void CYIHTTPRequest::SetIsConnectivityProbe | ( | bool | bIsConnectivityProbe | ) |
Called to tell the system that the request is for connectivity probing.
For internal use by YiConnectivity.
| void CYIHTTPRequest::SetMethod | ( | CYIHTTPRequest::METHOD | eMethod | ) |
Sets the HTTP request method.
| void CYIHTTPRequest::SetNetworkTimeoutMs | ( | uint32_t | uNetworkTimeoutMs | ) |
Sets the maximum amount of time, in milliseconds, which a request may take. This is the time from when the request is dequeued and the transfer has started to when the transfer is complete.
| void CYIHTTPRequest::SetOpaqueCleanupObject | ( | OpaqueCleanup * | pCleanup | ) |
Sets the opaque container used to clean up private objects.
For internal use only.
| void CYIHTTPRequest::SetPostData | ( | const CYIString & | postData | ) |
Attach POST data to this request. This data is ignored for GET requests.
| void CYIHTTPRequest::SetServer | ( | const CYIServer & | server | ) |
Sets the server for the request, to be used with OAuth requests.
| void CYIHTTPRequest::SetURL | ( | const CYIUrl & | url | ) |
Set the URL for the request.
| void CYIHTTPRequest::SetUseCookies | ( | bool | bUseCookies | ) |
Sets whether cookies from the cookies store are included in the request headers automatically. Cookies are not included by default.
| CYISignal<const std::shared_ptr<CYIHTTPRequest> &, const std::shared_ptr<CYIHTTPResponse> &, const HTTP_STATUS_CODE> CYIHTTPRequest::NotifyComplete |
Emitted when a success or failure response is received, or no response is available. Parameters included are request, response and status code.
| CYISignal<const std::shared_ptr<CYIHTTPRequest> &, const HTTP_STATUS_CODE, const CYIString &> CYIHTTPRequest::NotifyError |
Emitted when an error occured processing this request, and no response is available. Parameters included are the status code (which may be from the server or locally generated if an error occured during processing) and an error string.
| CYISignal<const std::shared_ptr<CYIHTTPRequest> &, const std::shared_ptr<CYIHTTPResponse> &, bool > CYIHTTPRequest::NotifyResponse |
Emitted when a response has been received for this request. The bool parameter will be true if the response is a cached response and false if the response is a server response.