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

# XblHttpCallGetHeaderAtIndex

> XblHttpCallGetHeaderAtIndex

# XblHttpCallGetHeaderAtIndex

获取 HTTP 调用中特定从零开始索引位置的响应标头。

## 语法

```cpp theme={null}
HRESULT XblHttpCallGetHeaderAtIndex(  
         XblHttpCallHandle call,  
         uint32_t headerIndex,  
         const char** headerName,  
         const char** headerValue  
)  
```

### 参数

*call*   \_In\_\
类型：[XblHttpCallHandle](/reference/live/xsapi-c/http_call_c/handles/xblhttpcallhandle)

HTTP 调用的句柄。

*headerIndex*   \_In\_\
类型：uint32\_t

响应标头的特定从零开始的索引。

*headerName*   \_Out\_\
类型：char\*\*

HTTP 调用的 UTF-8 编码响应标头名称。返回字符串指针的内存在 XblHttpCallHandle 对象的生命周期内有效，直到对其调用 XblHttpCallCloseHandle()。

*headerValue*   \_Out\_\
类型：char\*\*

HTTP 调用的 UTF-8 编码响应标头值。返回字符串指针的内存在 XblHttpCallHandle 对象的生命周期内有效，直到对其调用 XblHttpCallCloseHandle()。

### 返回值

类型：HRESULT

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

## 备注

只能在 HTTP 任务完成后调用 [XblHttpCallPerformAsync](/reference/live/xsapi-c/http_call_c/functions/xblhttpcallperformasync) 之后调用此函数。使用 [XblHttpCallGetNumHeaders](/reference/live/xsapi-c/http_call_c/functions/xblhttpcallgetnumheaders) 可以了解 HTTP 调用中有多少响应标头。

## 要求

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

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

## 另请参阅

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


## Related topics

- [HCHttpCallRequestGetHeaderAtIndex](/zh-CN/reference/live/httpclient/httpprovider/functions/hchttpcallrequestgetheaderatindex.md)
- [HCHttpCallResponseGetHeaderAtIndex](/zh-CN/reference/live/httpclient/httpclient/functions/hchttpcallresponsegetheaderatindex.md)
- [XblHttpCallGetHeader](/zh-CN/reference/live/xsapi-c/http_call_c/functions/xblhttpcallgetheader.md)
- [XblHttpCallGetNumHeaders](/zh-CN/reference/live/xsapi-c/http_call_c/functions/xblhttpcallgetnumheaders.md)
- [XblHttpCallRequestSetHeader](/zh-CN/reference/live/xsapi-c/http_call_c/functions/xblhttpcallrequestsetheader.md)
