I use
var obj = response.Content.ReadAsStringAsync().Result;
to get a result like
obj = {"productId":"12345"}.
How to get the value 12345 from the response result?
If you do not want to create an object & just need to quickly get the value, use Json.NET to parse your data into a JObject
& then use .GetValue
:
var productId = JObject.Parse(obj).GetValue("productId").Value<string>();
Or:
var productId = JObject.Parse(obj)["productId"].ToString();
Output:
"12345"