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

# HCWebSocketGetHeader

> HCWebSocketGetHeader

# HCWebSocketGetHeader

获取 WebSocket 的标头。

## Syntax

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

### Parameters

*websocket*   \_In\_\
Type: HCWebsocketHandle

WebSocket 的句柄。

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

WebSocket 的 UTF-8 编码标头名称。

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

WebSocket 的 UTF-8 编码标头值。

### Return value

Type: HRESULT

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

## Requirements

**Header:** httpProvider.h

**Library:** libHttpClient.GDK.lib

## See also

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


## Related topics

- [HCWebSocketGetHeaderAtIndex](/zh-CN/reference/live/httpclient/httpprovider/functions/hcwebsocketgetheaderatindex.md)
- [HCWebSocketGetNumHeaders](/zh-CN/reference/live/httpclient/httpprovider/functions/hcwebsocketgetnumheaders.md)
- [HCWebSocketSetHeader](/zh-CN/reference/live/httpclient/httpclient/functions/hcwebsocketsetheader.md)
- [HCGetWebSocketFunctions](/zh-CN/reference/live/httpclient/httpprovider/functions/hcgetwebsocketfunctions.md)
- [HCWebSocketGetEventFunctions](/zh-CN/reference/live/httpclient/httpclient/functions/hcwebsocketgeteventfunctions.md)
