NVIDIA DeepStream SDK API Reference

9.2 Release
ext::http::client::curl::HttpOperation Class Reference

Detailed Description

Public Member Functions

void DispatchEvent (opentelemetry::ext::http::client::SessionState type, const std::string &reason="")
 
 HttpOperation (opentelemetry::ext::http::client::Method method, std::string url, const opentelemetry::ext::http::client::HttpSslOptions &ssl_options, opentelemetry::ext::http::client::EventHandler *event_handle, const opentelemetry::ext::http::client::Headers &request_headers=opentelemetry::ext::http::client::Headers(), const opentelemetry::ext::http::client::Body &request_body=opentelemetry::ext::http::client::Body(), const opentelemetry::ext::http::client::Compression &compression=opentelemetry::ext::http::client::Compression::kNone, bool is_raw_response=false, std::chrono::milliseconds http_conn_timeout=kDefaultHttpConnTimeout, bool reuse_connection=false, bool is_log_enabled=false, const opentelemetry::ext::http::client::RetryPolicy &retry_policy={})
 Create local CURL instance for url and body. More...
 
virtual ~HttpOperation ()
 Destroy CURL instance. More...
 
virtual void Finish ()
 Finish CURL instance. More...
 
void Cleanup ()
 Cleanup all resource of curl. More...
 
bool IsRetryable ()
 Determine if operation is retryable. More...
 
std::chrono::system_clock::time_point NextRetryTime ()
 Calculate next time to retry request. More...
 
CURLcode Setup ()
 Setup request. More...
 
CURLcode Send ()
 Send request synchronously. More...
 
CURLcode SendAsync (Session *session, std::function< void(HttpOperation &)> callback=nullptr)
 Send request asynchronously. More...
 
void SendSync ()
 
StatusCode GetResponseCode () const noexcept
 Get HTTP response code. More...
 
CURLcode GetLastResultCode ()
 
opentelemetry::ext::http::client::SessionState GetSessionState ()
 Get last session state. More...
 
bool WasAborted ()
 Get whether or not response was programmatically aborted. More...
 
Headers GetResponseHeaders ()
 Return a copy of response headers. More...
 
const std::vector< uint8_t > & GetResponseBody () const noexcept
 Return a copy of response body. More...
 
const std::vector< uint8_t > & GetRawResponse () const noexcept
 Return a raw copy of response headers+body. More...
 
void ReleaseResponse ()
 Release memory allocated for response. More...
 
void Abort ()
 Abort request in connecting or reading state. More...
 
void PerformCurlMessage (CURLcode code)
 Perform curl message, this function only can be called in the polling thread and it can only be called when got a CURLMSG_DONE. More...
 
CURL * GetCurlEasyHandle () noexcept
 
void DispatchEvent (opentelemetry::ext::http::client::SessionState type, const std::string &reason="")
 
 HttpOperation (opentelemetry::ext::http::client::Method method, std::string url, const opentelemetry::ext::http::client::HttpSslOptions &ssl_options, opentelemetry::ext::http::client::EventHandler *event_handle, const opentelemetry::ext::http::client::Headers &request_headers=opentelemetry::ext::http::client::Headers(), const opentelemetry::ext::http::client::Body &request_body=opentelemetry::ext::http::client::Body(), const opentelemetry::ext::http::client::Compression &compression=opentelemetry::ext::http::client::Compression::kNone, bool is_raw_response=false, std::chrono::milliseconds http_conn_timeout=kDefaultHttpConnTimeout, bool reuse_connection=false, bool is_log_enabled=false, const opentelemetry::ext::http::client::RetryPolicy &retry_policy={})
 Create local CURL instance for url and body. More...
 
virtual ~HttpOperation ()
 Destroy CURL instance. More...
 
virtual void Finish ()
 Finish CURL instance. More...
 
void Cleanup ()
 Cleanup all resource of curl. More...
 
bool IsRetryable ()
 Determine if operation is retryable. More...
 
std::chrono::system_clock::time_point NextRetryTime ()
 Calculate next time to retry request. More...
 
CURLcode Setup ()
 Setup request. More...
 
CURLcode Send ()
 Send request synchronously. More...
 
CURLcode SendAsync (Session *session, std::function< void(HttpOperation &)> callback=nullptr)
 Send request asynchronously. More...
 
void SendSync ()
 
StatusCode GetResponseCode () const noexcept
 Get HTTP response code. More...
 
CURLcode GetLastResultCode ()
 
opentelemetry::ext::http::client::SessionState GetSessionState ()
 Get last session state. More...
 
bool WasAborted ()
 Get whether or not response was programmatically aborted. More...
 
Headers GetResponseHeaders ()
 Return a copy of response headers. More...
 
const std::vector< uint8_t > & GetResponseBody () const noexcept
 Return a copy of response body. More...
 
const std::vector< uint8_t > & GetRawResponse () const noexcept
 Return a raw copy of response headers+body. More...
 
void ReleaseResponse ()
 Release memory allocated for response. More...
 
void Abort ()
 Abort request in connecting or reading state. More...
 
void PerformCurlMessage (CURLcode code)
 Perform curl message, this function only can be called in the polling thread and it can only be called when got a CURLMSG_DONE. More...
 
CURL * GetCurlEasyHandle () noexcept
 

Friends

class HttpOperationAccessor
 

Constructor & Destructor Documentation

◆ HttpOperation() [1/2]

ext::http::client::curl::HttpOperation::HttpOperation ( opentelemetry::ext::http::client::Method  method,
std::string  url,
const opentelemetry::ext::http::client::HttpSslOptions &  ssl_options,
opentelemetry::ext::http::client::EventHandler *  event_handle,
const opentelemetry::ext::http::client::Headers &  request_headers = opentelemetry::ext::http::client::Headers(),
const opentelemetry::ext::http::client::Body &  request_body = opentelemetry::ext::http::client::Body(),
const opentelemetry::ext::http::client::Compression &  compression = opentelemetry::ext::http::client::Compression::kNone,
bool  is_raw_response = false,
std::chrono::milliseconds  http_conn_timeout = kDefaultHttpConnTimeout,
bool  reuse_connection = false,
bool  is_log_enabled = false,
const opentelemetry::ext::http::client::RetryPolicy &  retry_policy = {} 
)

Create local CURL instance for url and body.

Parameters
methodHTTP Method
urlHTTP URL
request_headersRequest Headers
request_bodyRequest Body
is_raw_responseWhether to parse the response
http_conn_timeoutHTTP connection timeout in seconds
reuse_connectionWhether connection should be reused or closed
is_log_enabledTo intercept some information from cURL request
retry_policyRetry policy for select failure status codes

◆ ~HttpOperation() [1/2]

virtual ext::http::client::curl::HttpOperation::~HttpOperation ( )
virtual

Destroy CURL instance.

◆ HttpOperation() [2/2]

ext::http::client::curl::HttpOperation::HttpOperation ( opentelemetry::ext::http::client::Method  method,
std::string  url,
const opentelemetry::ext::http::client::HttpSslOptions &  ssl_options,
opentelemetry::ext::http::client::EventHandler *  event_handle,
const opentelemetry::ext::http::client::Headers &  request_headers = opentelemetry::ext::http::client::Headers(),
const opentelemetry::ext::http::client::Body &  request_body = opentelemetry::ext::http::client::Body(),
const opentelemetry::ext::http::client::Compression &  compression = opentelemetry::ext::http::client::Compression::kNone,
bool  is_raw_response = false,
std::chrono::milliseconds  http_conn_timeout = kDefaultHttpConnTimeout,
bool  reuse_connection = false,
bool  is_log_enabled = false,
const opentelemetry::ext::http::client::RetryPolicy &  retry_policy = {} 
)

Create local CURL instance for url and body.

Parameters
methodHTTP Method
urlHTTP URL
request_headersRequest Headers
request_bodyRequest Body
is_raw_responseWhether to parse the response
http_conn_timeoutHTTP connection timeout in seconds
reuse_connectionWhether connection should be reused or closed
is_log_enabledTo intercept some information from cURL request
retry_policyRetry policy for select failure status codes

◆ ~HttpOperation() [2/2]

virtual ext::http::client::curl::HttpOperation::~HttpOperation ( )
virtual

Destroy CURL instance.

Member Function Documentation

◆ Abort() [1/2]

void ext::http::client::curl::HttpOperation::Abort ( )

Abort request in connecting or reading state.

◆ Abort() [2/2]

void ext::http::client::curl::HttpOperation::Abort ( )

Abort request in connecting or reading state.

◆ Cleanup() [1/2]

void ext::http::client::curl::HttpOperation::Cleanup ( )

Cleanup all resource of curl.

◆ Cleanup() [2/2]

void ext::http::client::curl::HttpOperation::Cleanup ( )

Cleanup all resource of curl.

◆ DispatchEvent() [1/2]

void ext::http::client::curl::HttpOperation::DispatchEvent ( opentelemetry::ext::http::client::SessionState  type,
const std::string &  reason = "" 
)

◆ DispatchEvent() [2/2]

void ext::http::client::curl::HttpOperation::DispatchEvent ( opentelemetry::ext::http::client::SessionState  type,
const std::string &  reason = "" 
)

◆ Finish() [1/2]

virtual void ext::http::client::curl::HttpOperation::Finish ( )
virtual

Finish CURL instance.

◆ Finish() [2/2]

virtual void ext::http::client::curl::HttpOperation::Finish ( )
virtual

Finish CURL instance.

◆ GetCurlEasyHandle() [1/2]

CURL* ext::http::client::curl::HttpOperation::GetCurlEasyHandle ( )
inlinenoexcept

◆ GetCurlEasyHandle() [2/2]

CURL* ext::http::client::curl::HttpOperation::GetCurlEasyHandle ( )
inlinenoexcept

◆ GetLastResultCode() [1/2]

CURLcode ext::http::client::curl::HttpOperation::GetLastResultCode ( )
inline

◆ GetLastResultCode() [2/2]

CURLcode ext::http::client::curl::HttpOperation::GetLastResultCode ( )
inline

◆ GetRawResponse() [1/2]

const std::vector<uint8_t>& ext::http::client::curl::HttpOperation::GetRawResponse ( ) const
inlinenoexcept

Return a raw copy of response headers+body.

Definition at line 246 of file 9.2/includes/opentelemetry/ext/http/client/curl/http_operation_curl.h.

◆ GetRawResponse() [2/2]

const std::vector<uint8_t>& ext::http::client::curl::HttpOperation::GetRawResponse ( ) const
inlinenoexcept

Return a raw copy of response headers+body.

Definition at line 246 of file includes/opentelemetry/ext/http/client/curl/http_operation_curl.h.

◆ GetResponseBody() [1/2]

const std::vector<uint8_t>& ext::http::client::curl::HttpOperation::GetResponseBody ( ) const
inlinenoexcept

Return a copy of response body.

Definition at line 241 of file 9.2/includes/opentelemetry/ext/http/client/curl/http_operation_curl.h.

◆ GetResponseBody() [2/2]

const std::vector<uint8_t>& ext::http::client::curl::HttpOperation::GetResponseBody ( ) const
inlinenoexcept

◆ GetResponseCode() [1/2]

StatusCode ext::http::client::curl::HttpOperation::GetResponseCode ( ) const
inlinenoexcept

◆ GetResponseCode() [2/2]

StatusCode ext::http::client::curl::HttpOperation::GetResponseCode ( ) const
inlinenoexcept

Get HTTP response code.

This function returns 0.

Definition at line 216 of file 9.2/includes/opentelemetry/ext/http/client/curl/http_operation_curl.h.

◆ GetResponseHeaders() [1/2]

Headers ext::http::client::curl::HttpOperation::GetResponseHeaders ( )

Return a copy of response headers.

◆ GetResponseHeaders() [2/2]

Headers ext::http::client::curl::HttpOperation::GetResponseHeaders ( )

◆ GetSessionState() [1/2]

opentelemetry::ext::http::client::SessionState ext::http::client::curl::HttpOperation::GetSessionState ( )
inline

Get last session state.

Definition at line 226 of file 9.2/includes/opentelemetry/ext/http/client/curl/http_operation_curl.h.

◆ GetSessionState() [2/2]

opentelemetry::ext::http::client::SessionState ext::http::client::curl::HttpOperation::GetSessionState ( )
inline

◆ IsRetryable() [1/2]

bool ext::http::client::curl::HttpOperation::IsRetryable ( )

Determine if operation is retryable.

◆ IsRetryable() [2/2]

bool ext::http::client::curl::HttpOperation::IsRetryable ( )

Determine if operation is retryable.

◆ NextRetryTime() [1/2]

std::chrono::system_clock::time_point ext::http::client::curl::HttpOperation::NextRetryTime ( )

Calculate next time to retry request.

◆ NextRetryTime() [2/2]

std::chrono::system_clock::time_point ext::http::client::curl::HttpOperation::NextRetryTime ( )

Calculate next time to retry request.

◆ PerformCurlMessage() [1/2]

void ext::http::client::curl::HttpOperation::PerformCurlMessage ( CURLcode  code)

Perform curl message, this function only can be called in the polling thread and it can only be called when got a CURLMSG_DONE.

Parameters
codeCURLcode

◆ PerformCurlMessage() [2/2]

void ext::http::client::curl::HttpOperation::PerformCurlMessage ( CURLcode  code)

Perform curl message, this function only can be called in the polling thread and it can only be called when got a CURLMSG_DONE.

Parameters
codeCURLcode

◆ ReleaseResponse() [1/2]

void ext::http::client::curl::HttpOperation::ReleaseResponse ( )

Release memory allocated for response.

◆ ReleaseResponse() [2/2]

void ext::http::client::curl::HttpOperation::ReleaseResponse ( )

Release memory allocated for response.

◆ Send() [1/2]

CURLcode ext::http::client::curl::HttpOperation::Send ( )

Send request synchronously.

◆ Send() [2/2]

CURLcode ext::http::client::curl::HttpOperation::Send ( )

Send request synchronously.

Referenced by SendSync().

◆ SendAsync() [1/2]

CURLcode ext::http::client::curl::HttpOperation::SendAsync ( Session *  session,
std::function< void(HttpOperation &)>  callback = nullptr 
)

Send request asynchronously.

Parameters
sessionThis operator must be binded to a Session
callbackcallback when start async request success and got response

◆ SendAsync() [2/2]

CURLcode ext::http::client::curl::HttpOperation::SendAsync ( Session *  session,
std::function< void(HttpOperation &)>  callback = nullptr 
)

Send request asynchronously.

Parameters
sessionThis operator must be binded to a Session
callbackcallback when start async request success and got response

◆ SendSync() [1/2]

void ext::http::client::curl::HttpOperation::SendSync ( )
inline

◆ SendSync() [2/2]

void ext::http::client::curl::HttpOperation::SendSync ( )
inline

◆ Setup() [1/2]

CURLcode ext::http::client::curl::HttpOperation::Setup ( )

Setup request.

◆ Setup() [2/2]

CURLcode ext::http::client::curl::HttpOperation::Setup ( )

Setup request.

◆ WasAborted() [1/2]

bool ext::http::client::curl::HttpOperation::WasAborted ( )
inline

Get whether or not response was programmatically aborted.

Definition at line 231 of file 9.2/includes/opentelemetry/ext/http/client/curl/http_operation_curl.h.

◆ WasAborted() [2/2]

bool ext::http::client::curl::HttpOperation::WasAborted ( )
inline

Get whether or not response was programmatically aborted.

Definition at line 231 of file includes/opentelemetry/ext/http/client/curl/http_operation_curl.h.

Referenced by ext::http::client::curl::HttpClientSync::Get(), and ext::http::client::curl::HttpClientSync::Post().

Friends And Related Function Documentation

◆ HttpOperationAccessor

HttpOperationAccessor
friend

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