Hi Jeremy,
Could I suggest not using response.Content.ReadAsStringAsync() and then serializing to object? It will impact the memory usage and depending on a response size, it can introduce also allocations on large-object-heap.
There is a new NuGet, provided by Microsoft, that makes working with JSON very smooth - System.Net.Http.Json.
You can read on some applications on Steve Gordon's blog post stevejgordon.co.uk/sending-and-rec...
Thanks for point that out, Bojan. The article you shared described the problem well. I made the change and it's working as expected so I'll update the article shortly.
Hi Jeremy,
Could I suggest not using
response.Content.ReadAsStringAsync()
and then serializing to object? It will impact the memory usage and depending on a response size, it can introduce also allocations on large-object-heap.There is a new NuGet, provided by Microsoft, that makes working with JSON very smooth - System.Net.Http.Json.
You can read on some applications on Steve Gordon's blog post stevejgordon.co.uk/sending-and-rec...
Thank you for this nice series of articles!
Thanks for point that out, Bojan. The article you shared described the problem well. I made the change and it's working as expected so I'll update the article shortly.
Glad if I helped :)