Emitted whenever the mock server is running and receives a request from a client.
Test code may connect to this signal and implement a handler which builds and returns a suitable response for a given message. The default handler reads a request–response pair from the current trace file, matches the requests and then returns the given response. If the requests don't match, an error is raised.
Signal handlers should return true if they have handled the request and set an appropriate response; and false otherwise.
| message |
a message containing the incoming HTTP(S) request, and which the outgoing HTTP(S) response should be set on |
| client |
additional data about the HTTP client making the request |