I'm making a call to an API using C# code.
I have an API class that has a GET method. (I admit that I got the code from a colleague and have just adapted it).
The ProcessRequest method takes the response from the WebRequest and stores it in a variable called feed
When I use the text visualizer to see what is coming back, then I see the item
key-value pair has a -0.0 value.
This unfortunately gives an error when I use Newtonsoft to deserialise into a class that I have defined as this field should be an integer. NOTE: THE ERROR NEWTONSOFT RETURNS IS IRRELEVANT TO ME AT THIS POINT
When I call the API using Postman, this is the result I get back ...
You can see that the last
KVP returns an integer value, which is what is expected.
Does anyone have any idea of why I am getting a different response in my C# code than I am from Postman, and what I can do about it?
Summary:- C# returns me a -0.0 in the value of that Key-Value pair Postman returns me a 0 in the value of that Key-Value pair
I'm unable to post a working code sample that hits the API as the API is a pay-for service.
Postman will prettify the result.
Clicking the Raw button, shows the -0.0 value coming back from the API provider, just as the C# code hinted at.