HCHttpCallPerformAsync
Perform HTTP call using the HCCallHandle.
Syntax
HRESULT HCHttpCallPerformAsync(
HCCallHandle call,
XAsyncBlock* asyncBlock
)
Parameters
call _In_
Type: HCCallHandle
The handle of the HTTP call
asyncBlock _Inout_
Type: XAsyncBlock*
The XAsyncBlock that defines the async operation
Return value
Type: HRESULT
Result code for this API operation. Possible values are S_OK, E_INVALIDARG, E_OUTOFMEMORY, or E_FAIL.
Remarks
First create a HTTP handle using HCHttpCallCreate(). Then call HCHttpCallRequestSet*() to prepare the HCCallHandle. Then call HCHttpCallPerformAsync() to perform HTTP call using the HCCallHandle. This call is asynchronous, so the work will be done on a background thread and will return via the callback. The perform call is asynchronous, so the work will be done on a background thread which calls XTaskQueueDispatch(..., XTaskQueuePort::Work). The results will return to the callback on the thread that calls XTaskQueueDispatch(..., XTaskQueuePort::Completion), then get the result of the HTTP call by calling HCHttpCallResponseGet*() to get the HTTP response of the HCCallHandle. When the HCCallHandle is no longer needed, call HCHttpCallCloseHandle() to free the memory associated with the HCCallHandle. HCHttpCallPerformAsync can only be called once. Create new HCCallHandle to repeat the call.
Requirements
Header: httpClient.h
Library: libHttpClient.141.GSDK.C.lib