Skip to main content
Performs an HTTP call by using an XblHttpCallHandle.

Syntax

Parameters

call   _In_
Type: XblHttpCallHandle
The handle of the HTTP call. type   _In_
Type: XblHttpCallResponseBodyType
The response body type to read the results of this HTTP call. We recommend XblHttpCallResponseBodyType::String if you read the response with XblHttpCallGetResponseString, or XblHttpCallResponseBodyType::Vector if you read it with XblHttpCallGetResponseBodyBytesSize and XblHttpCallGetResponseBodyBytes. This value doesn’t influence the content-type header, which must be supplied by calling XblHttpCallRequestSetHeader. 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 an HTTP call handle by calling XblHttpCallCreate. Then prepare the request by calling the XblHttpCallRequestSet* functions, such as XblHttpCallRequestSetHeader. Finally, call XblHttpCallPerformAsync. The call is asynchronous. The task queue in asyncBlock determines where the work and the completion callback run. For example, if the queue uses manual dispatch, the work runs on the thread that calls XTaskQueueDispatch(..., XTaskQueuePort::Work), and the callback runs on the thread that calls XTaskQueueDispatch(..., XTaskQueuePort::Completion). In the completion callback, call XAsyncGetStatus to get the result of the asynchronous operation. After the HTTP task completes, read the response by calling functions such as XblHttpCallGetStatusCode, XblHttpCallGetNetworkErrorCode, XblHttpCallGetHeader, XblHttpCallGetResponseString, or XblHttpCallGetResponseBodyBytes. XSAPI currently ignores type, so you can read the response with either the string function or the response body bytes functions. You can call XblHttpCallPerformAsync only once for each handle. To repeat the call, create a new handle. When you no longer need the handle, call XblHttpCallCloseHandle to free the memory associated with it.

Requirements

Header: http_call_c.h Library: Microsoft.Xbox.Services.142.C.lib or Microsoft.Xbox.Services.143.C.lib

See also

http_call_c
Last modified on October 29, 2026