Mocking HttpMessageHandler with moq – How do I get the contents of the request?

Is there a way to get the contents of the http request before deciding what kind of response I want to send back for the test? Multiple tests will use this class and each test will have multiple http requests. This code does not compile because the lambda is not async and there is an await in it. I’m new to async-await, so I’m not sure how to resolve this. I briefly considered having multiple TestHttpClientFactories, but that would mean duplicated code, so decided against it, if possible. Any help is appreciated.