C# Restsharp SimpleAuthenticator
我正在使用restsharp创建RESTAPI客户端。这是我的代码:C# Restsharp SimpleAuthenticator,c#,restsharp,C#,Restsharp,我正在使用restsharp创建RESTAPI客户端。这是我的代码: var client = new RestClient("https://url.com"); client.Authenticator = new SimpleAuthenticator("client_id", "testapi", "client_secret", "password"); var request = new RestRequest("webapi/res
var client = new RestClient("https://url.com");
client.Authenticator = new SimpleAuthenticator("client_id", "testapi", "client_secret", "password");
var request = new RestRequest("webapi/rest/auctions", Method.GET);
request.AddParameter("limit", "10");
request.AddParameter("order", "auction_id");
request.AddParameter("page", "1");
request.AddParameter("offset", "0");
IRestResponse response = client.Execute(request);
Console.WriteLine("request: " + response.Content);
响应总是:{“error”:“unauthorized_client”}
从这个rest api的文档中,您是否在Fiddler中查看了该请求,以验证其上是否有授权头?您的基本URI是否正确?