当我打电话给其他Api时,“无法连接到远程服务器”

时间:2019-06-24 16:24:59

标签: c# api rest-client

调用REST API时,我无法连接到远程服务器响应

var client = new RestClient { BaseUrl = new Uri(ConfigurationManager.AppSettings["WalletUrl"]) };
var hgh = ConfigurationManager.AppSettings["GetWalletRequest"];
var requests = new RestRequest(Method.POST)
{
    RequestFormat = DataFormat.Json
};
requests.AddHeader("content-type", "application/json");
requests.AddParameter("application/json", req, ParameterType.RequestBody);
requests.AddBody(req);
var response = client.Execute(requests);

0 个答案:

没有答案