This class prepares an OAuth HTTP Request over HTTP.
#include <network/YiOAuthRequest.h>
Public Member Functions | |
CYIOAuthRequest () | |
CYIOAuthRequest (const CYIServer &server) | |
CYIOAuthRequest (const CYIServer &server, const CYIUrl &url, CYIHTTPRequest::Method method) | |
virtual | ~CYIOAuthRequest () |
void | AddOAuthParameter (const CYIString &rKeyword, const CYIString &rValue) |
void | AddOAuthSignature (const CYIString &rSecret) |
void | ClearURLParameters () |
void | FinalizeOAuthParameters (const CYIString &rUserAccessToken, const CYIString &rUserAccessTokenSecret) |
![]() | |
CYIHTTPRequest () | |
CYIHTTPRequest (const CYIUrl &url, Method method=Method::GET) | |
CYIHTTPRequest (const CYIServer &server) | |
CYIHTTPRequest (const CYIServer &server, const CYIUrl &url, Method method) | |
virtual | ~CYIHTTPRequest () |
void | SetMethod (Method method) |
void | SetServer (const CYIServer &server) |
void | SetPostData (const std::vector< char > &postData) |
void | SetPostData (CYIStringView postData) |
const std::vector< char > & | GetPostData () const |
bool | AddHeader (CYIString name, CYIString value) |
std::vector< CYIHTTPHeader > | GetHeaders () const |
uint64_t | GetUniqueID () const |
void | SetContextID (uint32_t contextID) |
uint32_t | GetContextID () const |
void | SetCompressionType (CompressionType compressionType) |
CYIHTTPRequest::CompressionType | GetCompressionType () const |
Method | GetMethod () const |
void | SetURL (const CYIUrl &url) |
const CYIUrl & | GetURL () const |
const CYIServer | GetServer () const |
void | SetNetworkTimeoutMs (uint32_t networkTimeoutMs) |
uint32_t | GetNetworkTimeoutMs () const |
void | SetConnectionTimeoutMs (uint32_t connectionTimeoutMs) |
uint32_t | GetConnectionTimeoutMs () const |
void | SetIsConnectivityProbe (bool isConnectivityProbe) |
bool | IsConnectivityProbe () const |
void | SetUserAgent (const CYIString &userAgent) |
void | SetUseCookies (bool useCookies) |
bool | IsUsingCookies () const |
const CYIHTTPHeader::CacheDirectives & | GetCacheControlDirectives () const |
CYIHTTPRequestPriv * | GetPriv () const |
void | SetMetricsEnqueueTime (std::chrono::duration< uint64_t, std::micro > time) |
void | SetMetricsRequestTime (std::chrono::duration< uint64_t, std::micro > time) |
CYIHTTPRequest::Metrics | GetMetrics () const |
Additional Inherited Members | |
![]() | |
enum | Method { Method::GET, Method::PUT, Method::POST, Method::DELETE, Method::PATCH, Method::HEAD } |
Supported HTTP request methods. More... | |
enum | CompressionType { CompressionType::Compressed, CompressionType::GZIP } |
Provides a hint to the server if compression can be used on the response data. More... | |
![]() | |
CYISignal< std::shared_ptr< CYIHTTPRequest >, 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< std::shared_ptr< CYIHTTPRequest >, CYIHTTPService::HTTPStatusCode, 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< std::shared_ptr< CYIHTTPRequest >, std::shared_ptr< CYIHTTPResponse >, CYIHTTPService::HTTPStatusCode > | NotifyComplete |
Emitted when a success or failure response is received, or no response is available. Parameters included are request, response and status code. More... | |
CYIOAuthRequest::CYIOAuthRequest | ( | ) |
CYIOAuthRequest::CYIOAuthRequest | ( | const CYIServer & | server | ) |
CYIOAuthRequest::CYIOAuthRequest | ( | const CYIServer & | server, |
const CYIUrl & | url, | ||
CYIHTTPRequest::Method | method | ||
) |
|
virtual |
Adds an OAuth-specific keyword/value pair to the request. This pair will be used in computing the OAuth signature.
void CYIOAuthRequest::AddOAuthSignature | ( | const CYIString & | rSecret | ) |
Adds an OAuth-signature to the request.
The URI including the of oauth keyword/value pairs will be encoded as the signature data.
The application secret along with the optional secret will be used as the signature key.
void CYIOAuthRequest::ClearURLParameters | ( | ) |
Clears all parameters.
void CYIOAuthRequest::FinalizeOAuthParameters | ( | const CYIString & | rUserAccessToken, |
const CYIString & | rUserAccessTokenSecret | ||
) |
This has to be the last call after all other OAuth Parameters are specified using AddOAuthParameter(). This function will add necessary fields based on Get/Post method information and finalize the OAuth query with the signature. Token information will be retrieved from userData.