nkowalec
nkowalec
CC#
Created by Livid on 10/30/2023 in #help
✅ HttpClient to Json
You can use System.Text.Json to deserialization, or if you don't want DTO you can parse JsonDocument
string text = "{ \"prop1\": \"value1\" }";
var doc = JsonDocument.Parse(text);
var val = doc.RootElement.GetProperty("prop1").GetString();
string text = "{ \"prop1\": \"value1\" }";
var doc = JsonDocument.Parse(text);
var val = doc.RootElement.GetProperty("prop1").GetString();
16 replies