In C# i receive a json response:
var httpResponse = (HttpWebResponse)httpWebRequest.GetResponse();
using (var streamReader = new StreamReader(httpResponse.GetResponseStream()))
{
var result = streamReader.ReadToEnd();
...
}
The value of result is:
"[\"[{\\\"retcode\\\":0}]\"]"
Now if i try to deserialize it into my object:
var myobj = js.Deserialize<List<CustomerReturnCode>>(result);
where:
public class CustomerReturnCode
{
public string retcode { get; set; }
}
I get the following error:
"Cannot convert object of type 'System.String' to type 'CustomerReturnCode'"}
How can i deserialize the response type? (it's an array: in this example it has only one item)