【问题标题】:How to make restsharp to work with the right encoding for response?如何使 restsharp 使用正确的响应编码?
【发布时间】:2017-08-21 02:34:07
【问题描述】:

我也有类似这个问题的问题 RestSharp ignores response charset encoding.

但是没有正确的答案! 像这样的代码

IRestResponse RSP = client.Execute(request);

不是这样的

Encoding encoding = Encoding.GetEncoding("ISO-8859-1");
var result = encoding.GetString(response.RawBytes);

这意味着resetsharp必须用正确的编码反序列化结果。 有人可以帮忙吗?

【问题讨论】:

    标签: encoding restsharp


    【解决方案1】:

    我自己解决了这个问题

    你只需从 github 下载代码源并编辑代码

    stemp 1: 找到 HttpResponse.cs : 步骤 2:找到 Http.cs , Ohm,也许这个解决方案不适合你,我的请求结果是这样的,像我一样编辑代码就可以了 [在此处输入图片描述][3]

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-08-20
      • 2018-01-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多