Use following method/function to convert string having JSON data to JSON HttpResponseMessage -
Following code can be used to call this method/function
Following code can be used to call this method/function
public static HttpResponseMessage CreateJsonResponse(string json)
{
return new HttpResponseMessage()
{
Content
= new StringContent(json, System.Text.Encoding.UTF8, "application/json")
};
}
Following code can be used to call this method/function
var response = CreateJsonResponse(jSonString);
2 comments:
Thank you so much
Console.WriteLine("HTTP Response: " + responseString + "\n");
RestResponse restResponse = null;
if (acceptJSON)
Post a Comment