> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# XblHttpCallPerformAsync

> XblHttpCallPerformAsync

# XblHttpCallPerformAsync

Perform an HTTP call using the XblHttpCallHandle.

## Syntax

```cpp theme={null}
HRESULT XblHttpCallPerformAsync(  
         XblHttpCallHandle call,  
         XblHttpCallResponseBodyType type,  
         XAsyncBlock* asyncBlock  
)  
```

### Parameters

*call*   \_In\_\
Type: [XblHttpCallHandle](/reference/live/xsapi-c/http_call_c/handles/xblhttpcallhandle)

The handle of the HTTP call.

*type*   \_In\_\
Type: [XblHttpCallResponseBodyType](/reference/live/xsapi-c/http_call_c/enums/xblhttpcallresponsebodytype)

The response body type to read the results of this HTTP call. Note: this does not influence the content-type header, which must be supplied by calling [XblHttpCallRequestSetHeader](/reference/live/xsapi-c/http_call_c/functions/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 a HTTP handle using XblHttpCallCreate(). Then call XblHttpCallRequestSet\*() to prepare the XblHttpCallHandle. Then call XblHttpCallPerformAsync() to perform HTTP call using the XblHttpCallHandle. 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 XblHttpCallResponseGet\*() to get the HTTP response of the XblHttpCallHandle. When the XblHttpCallHandle is no longer needed, call XblHttpCallCloseHandle() to free the memory associated with the XblHttpCallHandle. XblHttpCallPerformAsync can only be called once. Create new XblHttpCallHandle to repeat the call.

## Requirements

**Header:** http\_call\_c.h

**Library:** Microsoft.Xbox.Services.14x.GDK.C.lib

## See also

[http\_call\_c](/reference/live/xsapi-c/http_call_c/http_call_c_members)


## Related topics

- [XblHttpCallRequestSetLongHttpCall](/reference/live/xsapi-c/http_call_c/functions/xblhttpcallrequestsetlonghttpcall.md)
- [XblHttpCallGetResponseString](/reference/live/xsapi-c/http_call_c/functions/xblhttpcallgetresponsestring.md)
- [XblHttpCallGetResponseBodyBytes](/reference/live/xsapi-c/http_call_c/functions/xblhttpcallgetresponsebodybytes.md)
- [XblHttpCallGetResponseBodyBytesSize](/reference/live/xsapi-c/http_call_c/functions/xblhttpcallgetresponsebodybytessize.md)
- [XblHttpCallGetHeader](/reference/live/xsapi-c/http_call_c/functions/xblhttpcallgetheader.md)
