-
Notifications
You must be signed in to change notification settings - Fork 10.3k
HttpClient.PostAsync() send Get requests #10176
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
Comments
There is certainly some weirdness here. What are you expecting to be returned from the endpoint? Regards to the response with the auth challenge, that's normal. |
@olkuziv, HttpClient is automatically added to your application as a Singleton service. The HttpClient is based on the WebAssemblyHttpMessageHandler. Why do you add HttpClient as a scoped service, and based on HttpClientHandler ? I'm not suggesting that it is related to your issue...just wondering why you coded that way ? |
@olkuziv, perhaps this link can solve your problem: |
Thanks for contacting us, @olkuziv. |
Yes, You are right. I should pass cookies in HttpClient headers |
Describe the bug
After adding [Authorize] attribute on Post method, aftert calling HttpClient.PostAsync() working like GetAsync().
To Reproduce
Steps to reproduce the behavior:
Screenshots
The text was updated successfully, but these errors were encountered: