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

# XblHttpCallRequestSetHeader

> XblHttpCallRequestSetHeader

# XblHttpCallRequestSetHeader

为 HTTP 调用设置请求标头。

## 语法

```cpp theme={null}
HRESULT XblHttpCallRequestSetHeader(  
         XblHttpCallHandle call,  
         const char* headerName,  
         const char* headerValue,  
         bool allowTracing  
)  
```

### 参数

*call*   \_In\_\
类型：[XblHttpCallHandle](https://docs.xbox.com/zh-CN/reference/live/xsapi-c/http_call_c/handles/xblhttpcallhandle.md)

HTTP 调用的句柄。

*headerName*   \_In\_z\_\
类型：char\*

HTTP 调用的 UTF-8 编码请求标头名称。

*headerValue*   \_In\_z\_\
类型：char\*

HTTP 调用的 UTF-8 编码请求标头值。

*allowTracing*   \_In\_\
类型：bool

设置为 false 可跳过跟踪此请求标头，例如当该标头包含私密信息时。

### 返回值

类型：HRESULT

此 API 操作的结果代码。可能的值为 S\_OK、E\_INVALIDARG、E\_OUTOFMEMORY 或 E\_FAIL。

## 备注

必须在调用 [XblHttpCallPerformAsync](https://docs.xbox.com/zh-CN/reference/live/xsapi-c/http_call_c/functions/xblhttpcallperformasync.md) 之前调用此函数。

## 要求

**头文件：** http\_call\_c.h

**库：** Microsoft.Xbox.Services.14x.GDK.C.lib

## 另请参阅

[http\_call\_c](https://docs.xbox.com/zh-CN/reference/live/xsapi-c/http_call_c/http_call_c_members.md)


## Related topics

- [XblHttpCallPerformAsync](https://docs.xbox.com/zh-CN/reference/live/xsapi-c/http_call_c/functions/xblhttpcallperformasync.md)
- [http_call_c](https://docs.xbox.com/zh-CN/reference/live/xsapi-c/http_call_c/http_call_c_members.md)
- [HCHttpCallRequestSetHeader](https://docs.xbox.com/zh-CN/reference/live/httpclient/httpclient/functions/hchttpcallrequestsetheader.md)
- [XblHttpCallRequestSetLongHttpCall](https://docs.xbox.com/zh-CN/reference/live/xsapi-c/http_call_c/functions/xblhttpcallrequestsetlonghttpcall.md)
- [XblHttpCallRequestSetRequestBodyBytes](https://docs.xbox.com/zh-CN/reference/live/xsapi-c/http_call_c/functions/xblhttpcallrequestsetrequestbodybytes.md)
