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

# HCHttpCallResponseSetHeaderWithLength

> HCHttpCallResponseSetHeaderWithLength

# HCHttpCallResponseSetHeaderWithLength

为 HTTP 调用设置响应标头。

## Syntax

```cpp theme={null}
HRESULT HCHttpCallResponseSetHeaderWithLength(  
         HCCallHandle call,  
         const char* headerName,  
         size_t nameSize,  
         const char* headerValue,  
         size_t valueSize  
)  
```

### Parameters

*call*   \_In\_\
Type: HCCallHandle

HTTP 调用的句柄。

*headerName*   \_In\_reads\_(nameSize)\
Type: char\*

HTTP 调用的 UTF-8 编码响应标头名称。

*nameSize*   \_In\_\
Type: size\_t

标头名称字符串的长度（以字节为单位）。

*headerValue*   \_In\_reads\_(valueSize)\
Type: char\*

HTTP 调用的 UTF-8 编码响应标头值。

*valueSize*   \_In\_\
Type: size\_t

标头值字符串的长度（以字节为单位）。

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

- [HCHttpCallResponseSetHeader](/zh-CN/reference/live/httpclient/httpprovider/functions/hchttpcallresponsesetheader.md)
- [HCHttpCallResponseSetResponseBodyBytes](/zh-CN/reference/live/httpclient/httpprovider/functions/hchttpcallresponsesetresponsebodybytes.md)
- [HCHttpCallResponseSetResponseBodyWriteFunction](/zh-CN/reference/live/httpclient/httpclient/functions/hchttpcallresponsesetresponsebodywritefunction.md)
- [HCHttpCallResponseSetStatusCode](/zh-CN/reference/live/httpclient/httpprovider/functions/hchttpcallresponsesetstatuscode.md)
- [HCHttpCallResponseSetGzipCompressed](/zh-CN/reference/live/httpclient/httpclient/functions/hchttpcallresponsesetgzipcompressed.md)
