mockhttp icon indicating copy to clipboard operation
mockhttp copied to clipboard

Feature request: expose collected requests

Open johnknoop opened this issue 5 years ago • 1 comments

Hi and thanks for a great library!

In order to have good failure messages in my tests, I generally do this:

httpMock.Fallback
    .Respond(req => throw new Exception($"No matcher found: {req.Method} {req.RequestUri.PathAndQuery}"));

But some of my tests contain tens of different HTTP requests, and in order for a failing test to point me in the right direction, it would be great if I could get the last matched request from the mock, so that I can add that to my failure message, like:

Last successful HTTP request: POST /somepath?my=query

johnknoop avatar Nov 03 '20 18:11 johnknoop

I have a similar use-case, but my ideal solution would be to expose a history of all matched requests rather than just the last one.

domn1995 avatar Aug 21 '24 18:08 domn1995