RestRequest在Postman中工作,但在C#中给出403 Forbidden错误

时间:2019-10-24 10:09:00

标签: c# postman restsharp

我正在使用RestSharp来获取C#中的url响应,但始终显示403 Forbidden错误。在邮递员中,它工作正常,我获得了200成功。这是我在C#中的代码:

var client = new RestClient("https://data.fei.org/Calendar/ShowDetail.aspx?p=17C909D981B698168E94ACB4EB1963B1");
var request = new RestRequest(Method.GET);
request.AddHeader("postman-token", "45b65980-83be-7d2f-a60d-e1238dbd9417");
request.AddHeader("cache-control", "no-cache");
IRestResponse response = client.Execute(request);

我要怎么做才能得到这个错误?

Postman image link

0 个答案:

没有答案