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

# HCWebSocketGetHeader

> HCWebSocketGetHeader

Get a header for the WebSocket.

## Syntax

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

### Parameters

*websocket*   \_In\_\
Type: HCWebsocketHandle

The handle of the WebSocket.

*headerName*   \_In\_z\_\
Type: char\*

UTF-8 encoded header name for the WebSocket.

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

UTF-8 encoded header value for the WebSocket.

### Return value

Type: HRESULT

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

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

- [httpProvider (contents)](https://docs.xbox.com/reference/live/httpclient/httpprovider/httpprovider_members.md)
- [HCWebSocketGetHeaderAtIndex](https://docs.xbox.com/reference/live/httpclient/httpprovider/functions/hcwebsocketgetheaderatindex.md)
- [HCWebSocketGetResponseHeader](https://docs.xbox.com/reference/live/httpclient/httpclient/functions/hcwebsocketgetresponseheader.md)
- [HCWebSocketGetNumHeaders](https://docs.xbox.com/reference/live/httpclient/httpprovider/functions/hcwebsocketgetnumheaders.md)
- [HCWebSocketGetResponseHeaderAtIndex](https://docs.xbox.com/reference/live/httpclient/httpclient/functions/hcwebsocketgetresponseheaderatindex.md)
