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

# HCWebSocketGetNumHeaders

> HCWebSocketGetNumHeaders

# HCWebSocketGetNumHeaders

获取 WebSocket 中的标头数量。

## Syntax

```cpp theme={null}
HRESULT HCWebSocketGetNumHeaders(  
         HCWebsocketHandle websocket,  
         uint32_t* numHeaders  
)  
```

### Parameters

*websocket*   \_In\_\
Type: HCWebsocketHandle

WebSocket 的句柄。

*numHeaders*   \_Out\_\
Type: uint32\_t\*

WebSocket 中的标头数量。

### Return value

Type: HRESULT

此 API 操作的结果代码。可能的值为 S\_OK、E\_INVALIDARG 或 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)
- [HCWebSocketGetHeader](/zh-CN/reference/live/httpclient/httpprovider/functions/hcwebsocketgetheader.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)
