Skip to main content
Add an intermediate callback that will be called when the specified mock is matched. This gives the client another opportunity to specify the mock response.

Syntax

Parameters

call   _In_
Type: HCMockCallHandle
The matched mock. callback   _In_
Type: HCMockMatchedCallback
Callback to be invoked when the mock is matched. context   _In_opt_
Type: void*
Client context.

Return value

Type: HRESULT Result code for this API operation. Possible values are S_OK, E_INVALIDARG, or E_FAIL.

Remarks

libHttpClient invokes the callback when a request attempt matches the mock, before it copies the mock response to the attempt. The callback runs on a thread that dispatches the work port of the task queue for the call. For details, see HCMockMatchedCallback.

Requirements

Header: mock.h Library: libHttpClient.lib Supported platforms: Windows, XBOX One family consoles and XBOX Series consoles

See also

mock
HCMockMatchedCallback
HCMockAddMock
Last modified on October 30, 2026