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

# HCSetHttpCallPerformFunction

> HCSetHttpCallPerformFunction

# HCSetHttpCallPerformFunction

可选地允许调用方实现 HTTP perform 函数。

## Syntax

```cpp theme={null}
HRESULT HCSetHttpCallPerformFunction(  
         HCCallPerformFunction performFunc,  
         void* performContext  
)  
```

### Parameters

*performFunc*   \_In\_\
Type: HCCallPerformFunction

按需实现 HTTP perform 函数的回调。

*performContext*   \_In\_opt\_\
Type: void\*

回调的上下文。

### Return value

Type: HRESULT

此 API 操作的结果代码。可能的值为 S\_OK 或 E\_HC\_ALREADY\_INITIALISED。

## Remarks

必须在 HCInit 之前调用。在 HCCallPerformFunction 回调中，使用 HCHttpCallRequestGet\*() 和 HCSettingsGet\*() 获取有关 HTTP 调用的信息，按需执行调用，并使用 HCHttpCallResponseSet\*() 设置响应。

## Requirements

**Header:** httpProvider.h

**Library:** libHttpClient.GDK.lib

## See also

[httpProvider](/reference/live/httpclient/httpprovider/httpprovider_members)


## Related topics

- [HCGetHttpCallPerformFunction](/zh-CN/reference/live/httpclient/httpprovider/functions/hcgethttpcallperformfunction.md)
- [HCHttpCallResponseSetResponseBodyWriteFunction](/zh-CN/reference/live/httpclient/httpclient/functions/hchttpcallresponsesetresponsebodywritefunction.md)
- [HCHttpCallRequestSetRequestBodyReadFunction](/zh-CN/reference/live/httpclient/httpclient/functions/hchttpcallrequestsetrequestbodyreadfunction.md)
- [HCHttpCallPerformAsync](/zh-CN/reference/live/httpclient/httpclient/functions/hchttpcallperformasync.md)
- [XblHttpCallPerformAsync](/zh-CN/reference/live/xsapi-c/http_call_c/functions/xblhttpcallperformasync.md)
