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

# HCWebSocketGetHeaderAtIndex

> HCWebSocketGetHeaderAtIndex

Gets the headers at specific zero based index in the WebSocket.

## Syntax

```cpp theme={null}
HRESULT HCWebSocketGetHeaderAtIndex(  
         HCWebsocketHandle websocket,  
         uint32_t headerIndex,  
         const char** headerName,  
         const char** headerValue  
)  
```

### Parameters

*websocket*   \_In\_\
Type: HCWebsocketHandle

The handle of the WebSocket.

*headerIndex*   \_In\_\
Type: uint32\_t

Specific zero based index of the header.

*headerName*   \_Out\_\
Type: char\*\*

UTF-8 encoded header name for the HTTP call.

*headerValue*   \_Out\_\
Type: char\*\*

UTF-8 encoded header value for the HTTP call.

### Return value

Type: HRESULT

Result code for this API operation. Possible values are S\_OK, E\_INVALIDARG, or E\_FAIL.

## Remarks

Use HCHttpCallGetNumHeaders() to know how many headers there are in the HTTP call.

## Requirements

**Header:** httpProvider.h

**Library:** libHttpClient.lib

**Supported platforms:** Windows, XBOX One family consoles and XBOX Series consoles

## See also

[httpProvider](https://docs.xbox.com/reference/live/httpclient/httpprovider/httpprovider_members.md)


## Related topics

- [HCWebSocketConnectFunction](https://docs.xbox.com/reference/live/httpclient/httpprovider/functions/hcwebsocketconnectfunction.md)
- [httpProvider (contents)](https://docs.xbox.com/reference/live/httpclient/httpprovider/httpprovider_members.md)
- [HCWebSocketGetResponseHeaderAtIndex](https://docs.xbox.com/reference/live/httpclient/httpclient/functions/hcwebsocketgetresponseheaderatindex.md)
- [HCWebSocketGetResponseHeader](https://docs.xbox.com/reference/live/httpclient/httpclient/functions/hcwebsocketgetresponseheader.md)
- [HCWebSocketGetNumResponseHeaders](https://docs.xbox.com/reference/live/httpclient/httpclient/functions/hcwebsocketgetnumresponseheaders.md)
