Collectives™ on Stack Overflow
Find centralized, trusted content and collaborate around the technologies you use most.
Learn more about Collectives
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more about Teams
In one of the Net API controllers, I have an action which sends the request to another third party API and after receiving a response it does some manipulation with the JSON data received and finally returns the response to the frontend application. Sample code is given below:
using (var client = new HttpClient())
var response = await client.GetAsync(_remoteServiceEndPoint + "student/" + id);
if (response.IsSuccessStatusCode)
var contentString = await response.Content.ReadAsStringAsync();
//do something with contents and finally return response to the caller
Now if the third party sends a JSON response which contains a number like 999999999999999.99
and the ReadAsStringAsync
executes in the above code snippet, it changes the value to 10000000000000000
. Which I don't want.
I would like to know why ReadAsStringAsync
is behaving like this.
–
–
–
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.