Skip to content

Callback on requests

skwasjer edited this page Jan 17, 2020 · 2 revisions

When a callback is configured, it will be called before the request handler is called and a response is produced and returned. This can be useful to track custom state or manipulate the response further.

mockHttp
    .When(...)
    .Callback(request => { /* Do something */ })
    .Respond(...)
Clone this wiki locally