Skip to content
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

Not Compatible with Sync HttpClient Send #104

Closed
microalps opened this issue Nov 11, 2022 · 4 comments
Closed

Not Compatible with Sync HttpClient Send #104

microalps opened this issue Nov 11, 2022 · 4 comments
Milestone

Comments

@microalps
Copy link

Functional impact

Unable to utilize new Send method implemented in NET5 - dotnet/runtime#34948

Expected result

Return a response, same as awaiting the async version. MockHttpMessageHandler does not implement Send.

Actual result

NotSupportedException: The synchronous method is not supported by 'RichardSzalay.MockHttp.MockHttpMessageHandler'. If you're using a custom 'HttpMessageHandler' and wish to use synchronous HTTP methods, you must override its 'Send' virtual method.

@microalps
Copy link
Author

@richardszalay would you be open to a PR? It will also need a dedicated .NET 5 build I guess (not netstandard)

@richardszalay
Copy link
Owner

@microalps Do you actually target net5? Given net5's SLS status I'd be more inclined to target net6 if that works for you.

@microalps
Copy link
Author

No, but since the change is on net5 I suggested it. I use net6.

@richardszalay
Copy link
Owner

Support for this is coming in MockHttp 7.0.0. I will close this ticket once it is released.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants