> ## 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

Effectue un appel HTTP à l'aide du XblHttpCallHandle.

## Syntaxe

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

### Paramètres

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

Handle de l'appel HTTP.

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

Type de corps de réponse utilisé pour lire les résultats de cet appel HTTP. Remarque : cela n'influence pas l'en-tête content-type, qui doit être fourni en appelant [XblHttpCallRequestSetHeader](/fr-CA/reference/live/xsapi-c/http_call_c/functions/xblhttpcallrequestsetheader).

*asyncBlock*   \_Inout\_\
Type : XAsyncBlock\*

XAsyncBlock qui définit l'opération asynchrone.

### Valeur de retour

Type : HRESULT

Code de résultat de cette opération d'API. Les valeurs possibles sont S\_OK, E\_INVALIDARG, E\_OUTOFMEMORY ou E\_FAIL.

## Remarques

Créez d'abord un handle HTTP à l'aide de XblHttpCallCreate(). Appelez ensuite XblHttpCallRequestSet\*() pour préparer le XblHttpCallHandle. Appelez ensuite XblHttpCallPerformAsync() pour effectuer l'appel HTTP à l'aide du XblHttpCallHandle. Cet appel est asynchrone; le travail sera donc effectué sur un thread d'arrière-plan et le résultat sera retourné par l'intermédiaire du rappel. L'appel d'exécution est asynchrone; le travail sera donc effectué sur un thread d'arrière-plan qui appelle XTaskQueueDispatch(..., XTaskQueuePort::Work). Les résultats seront retournés au rappel sur le thread qui appelle XTaskQueueDispatch(..., XTaskQueuePort::Completion); obtenez ensuite le résultat de l'appel HTTP en appelant XblHttpCallResponseGet\*() pour obtenir la réponse HTTP du XblHttpCallHandle. Lorsque le XblHttpCallHandle n'est plus nécessaire, appelez XblHttpCallCloseHandle() pour libérer la mémoire associée au XblHttpCallHandle. XblHttpCallPerformAsync ne peut être appelée qu'une seule fois. Créez un nouveau XblHttpCallHandle pour répéter l'appel.

## Configuration requise

**En-tête :** http\_call\_c.h

**Bibliothèque :** Microsoft.Xbox.Services.14x.GDK.C.lib

## Voir aussi

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


## Related topics

- [XblHttpCallPerformAsync](/reference/live/xsapi-c/http_call_c/functions/xblhttpcallperformasync.md)
- [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)
