当我尝试反序列化响应数据时,我收到了错误
“无法将当前 JSON 数组(例如 [1,2,3])反序列化为类型 'CModellassType',因为该类型需要 JSON 对象(例如 {"name":"value"})才能正确反序列化。"
string responseData = responseCategory.Content.ReadAsStringAsync().Result;
UploadApiResponse UploadApiResponseModel = JsonConvert.DeserializeObject<UploadApiResponse>(responseData);
public class UploadApiResponse
{
public int StatusCode { get; set; }
public string Message { get; set; }
public bool IsError { get; set; }
public Data Data { get; set; }
}
public class Data
{
public string AccessToken { get; set; }
}
{
"StatusCode":1,
"Message":"Invalid Parameter.",
"IsError":true,
"Data":[
"CurrencyCode is empty or (greater then 3 or less then 3)"
]
}