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

# HCMockResponseSetHeader

> HCMockResponseSetHeader

# HCMockResponseSetHeader

Set a response header to return for the mock.

## Syntax

```cpp theme={null}
HRESULT HCMockResponseSetHeader(  
         HCMockCallHandle call,  
         const char* headerName,  
         const char* headerValue  
)  
```

### Parameters

*call*   \_In\_\
Type: HCMockCallHandle

The handle of the HTTP call.

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

UTF-8 encoded response header name for the HTTP call.

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

UTF-8 encoded response header value for the HTTP call.

### Return value

Type: HRESULT

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

## Requirements

**Header:** mock.h

**Library:** libHttpClient.GDK.lib

## See also

[mock](/reference/live/httpclient/mock/mock_members)


## Related topics

- [HCMockResponseSetResponseBodyBytes](/reference/live/httpclient/mock/functions/hcmockresponsesetresponsebodybytes.md)
- [HCMockResponseSetStatusCode](/reference/live/httpclient/mock/functions/hcmockresponsesetstatuscode.md)
- [HCMockResponseSetNetworkErrorCode](/reference/live/httpclient/mock/functions/hcmockresponsesetnetworkerrorcode.md)
- [HCHttpCallResponseSetHeader](/reference/live/httpclient/httpprovider/functions/hchttpcallresponsesetheader.md)
- [HCHttpCallResponseSetHeaderWithLength](/reference/live/httpclient/httpprovider/functions/hchttpcallresponsesetheaderwithlength.md)
