对RestSharp的响应错误的字符集(可能)

时间:2017-12-13 17:04:22

标签: c# encoding restsharp

我在RestSharp客户端上有一个服务器响应,如果我在PostMan上获取响应,它会很好:  示例:instalação 但是,当我调用在RestSharp客户端上尝试此响应时,它是这样的:  示例:instala o

代码: {

 var requestatt = new RestRequest("/mge/service.sbr?serviceName=CRUDServiceProvider.loadView", Method.POST);
          // requestsharp.AddXmlBody(stringrequest);
          requestatt.AddParameter("text/xml", bodyrequestatt, ParameterType.RequestBody);
          requestatt.AddHeader("Content-Type", "text/xml;charset=ISO-8859-1");
          IRestResponse responseatt = new RestResponse();
          responseatt.ContentEncoding = "ISO-8859-1";
          responseatt = client.Execute(requestatt);

}

0 个答案:

没有答案