我正在尝试使用RestSharp来访问Etsy的API.这是我尝试获取OAuth访问令牌的代码:
var authenticator = OAuth1Authenticator.ForRequestToken(
ConfigurationManager.AppSettings["ApiKey"],
ConfigurationManager.AppSettings["ApiSecret"]);
// same result with or without this next line:
// authenticator.ParameterHandling = OAuthParameterHandling.UrlOrPostParameters;
this.Client.Authenticator = authenticator;
var request = new RestRequest("oauth/request_token")
.AddParameter("scope", "listings_r");
var response = this.Client.Execute(request);
Run Code Online (Sandbox Code Playgroud)
Etsy告诉我签名无效.有趣的是,当我将请求生成的时间戳和随机数值输入到此OAuth签名验证工具中时,签名不匹配.此外,该工具生成的URL与Etsy一起使用,其中RestSharp生成的URL不支持.有什么我做错了或我需要用RestSharp配置的其他东西?
注意:我正在使用他们的Nuget包提供的RestSharp版本,该版本在发布时为102.5.