❔ Bad request (400) - web api
I am not sure why this is happening because it works splendid with one class and not with another class for whatever reason. The code is basically identical in the controllers (and repositories).
I don't have the code to show you because it's code from a friend of mine earlier today through Zoom.
What we discovered was is that the POST method does not execute in the controller at all. The 400 error message is thrown before it actually connects to the API.
It works through Swagger though, so there's an issue with the httpclient I guess but I can't really seem to pinpoint what the issue is. We are using PostAsJsonAsync in this case.
My question for this whole thread is: Can I somehow print out the details of the "bad request" error code? What part is "bad"?
The error codes gives you a good pointer but when you really can't see what the hell is going wrong, you want the details. So how do I get them? 😅
4 Replies
Thank you @Henkypenky!
I'll give it a try with my mate as soon as I can!
np
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.