-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fails to read response content twice #21
Comments
If I change to this mockHandler
.When("/test")
.Respond(HttpStatusCode.OK, new ObjectContent<ResponseDto>(new ResponseDto("OK"), new JsonMediaTypeFormatter())); Then response content is not null the second time. But it would be good if the json string would work because that's the format I have in my expected payloads. I would like to avoid creating the Dtos before the mocks. |
Hi Martin, This is actually a limitation with how
There's not much point attempting to workaroud this in my opinion, so I'd advise simply limiting your application to only call Cheers, |
It just occurred to me that you are actually making the request twice, so the real HttpClient would actually send back two different responses. This is definitely a bug in MockHttp's behavior. Thanks for bringing it to my attention. I'll look at fixing this behavior, but in the meantime you can workaround it by using a different
|
This has been resolved in v1.3.1, now available on NuGet. |
The text was updated successfully, but these errors were encountered: