反序列化.Pages.Response类型的对象时出错。 ' PVTLTD'包含无效的UTF8字节

时间:2016-10-05 11:36:55

标签: c# .net json serializer

HttpWebRequest request = WebRequest.Create(requestUrl) as HttpWebRequest;
using (HttpWebResponse response = request.GetResponse() as HttpWebResponse)
{
    if (response.StatusCode != HttpStatusCode.OK)
        throw new Exception(String.Format(
        "Server errOr (HTTP {0}: {1}).",
        response.StatusCode,
        response.StatusDescription));
    DataContractJsonSerializer jsonSerializer = new DataContractJsonSerializer(typeof(Clari5AppWeb.Pages.Response));
    object objResponse = jsonSerializer.ReadObject(response.GetResponseStream());
    Response jsonResponse = objResponse as Response;
    return jsonResponse;

请解决;仅对某些搜索值,它会给出错误。

0 个答案:

没有答案