Reputation: 109
I am making HTTP Post request to Rest service
Content: application/x-www-form-urlencoded Accept: application/x-www-form-urlencoded
I get response in below format
"{\r\n\t\"status\":\"Success\"\r\n}"
Is there any good way to load this string and read status
Upvotes: 0
Views: 495
Reputation: 1479
Check out the Json.Net library: http://james.newtonking.com/json (Nuget: Newtonsoft.Json)
You could digest the response into a dynamic class:
var testData = "{\r\n\t\"status\":\"Success\"\r\n}";
dynamic testObject = JsonConvert.DeserializeObject(testData);
Console.WriteLine(testObject.status); //Success
Console.ReadKey();
Upvotes: 1