I have an API methd in .NET MVC which consume a web service from a third party the serviec was working fine two days ago Now when I am calling getresponse it return an exception 400 bad request , THERE IS NO CHANGE IN IMPLEMENTAITON same Api was working two days ago fine , the api provider also said that he has done no change the URL parameters both are same , might be some network issue but why it gives 404 bad request on calling getresponse I did telnet it works fien so what else could be the reason remember I am not checking in browser so no browser based issue I am checking via post man and my method is simple controller method with post verb, no rest based api method like latest 2.0 api rather it is simple controller method.
Loading
PakeezaPosted Nov 12, 2023, 12:52 PM
Thanks tahir for the response about network I might not be very clear when I went to my network team they said if telnet is ok then all is ok and the statistics shows the request send successfully .what else I could test at network side is there any way to get the exact reason of the issue of this bad request error
Tahir AnsariPosted Nov 12, 2023, 8:10 AM
he 400 Bad Request error typically indicates a problem with the request being sent, but as you've mentioned that there have been no changes in the code or the API.
Headers or Content: The request headers or content being sent might be interpreted differently by the server. Ensure that the headers and payload sent match the expected format by the third-party service.
Request Format: Sometimes, slight variations in how the request is structured can cause issues. Check the content type, encoding, and payload structure to align with the API's requirements.
Encoding or Character Issues: Look out for changes in encoding or unexpected characters in the request. Special characters might be causing the issue.
Firewall or Security Changes: Any updates in your network's security settings or firewall might be interfering with the API requests.
Temporary Network Issue: Although telnet might be successful, there could be intermittent issues between your server and the third-party service.
Server-Side Changes: Even if the third party claims no changes, there could be alterations or updates on their end causing this discrepancy.