我试图使用RestSharp来访问Etsy的API。下面是我使用的是试图获取OAuth访问令牌代码:使用RestSharp获取signature_invalid为Etsy的API调用oauth/request_token
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);
Etsy的告诉我,签名是无效的。有趣的是,当我将请求生成的时间戳和随机数值输入到OAuth signature validation tool时,签名不匹配。而且,该工具生成的URL与Etsy一起使用,其中RestSharp生成的URL不会。有什么我做错了或我需要用RestSharp配置的其他东西吗?
注意:我使用的是由他们的Nuget包提供的RestSharp版本,该版本在发布时为102.5。
可能还想发布到http://groups.google.com/group/restsharp –
会不会,谢谢! –