Ok, using a .NET application I am POSTing web requests to an API which is poorly supported; will not mention Microsoft by name but it is theirs!
When I POST valid data all is good and I get a HTTP Created response as expected, yippee...
However, when I post invalid data I don't get a response back; instead it throws an HTTP Error 400 Bad request exception with no other messages. And when I say invalid data it could be an invalid date or something not a malformed request.
I have tried catching the exception and webwexception and studied the stack trace but cannot see the reason for the post failing.
If I try the same POST in Postman I do see the reason failing;
"error": {
"code":"BadRequest",
"message":"Cannot convert a value to target type 'Edm.Decimal' because of conflict between input format string/number and parameter 'IEEE754Compatible' false/true. CorrelationId: 6fcac78c-7c2a-41c0-95fa-f1eb9908ca8b."}}
My question is, where does Postman get the error message from? I need to be able to trap this in code so I can determine what is wrong with the data.
Any help would be most appreciated.
What I have tried:
Catching and analysing the exception; googled everywhere.