Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Your code example defines <code>reqURL</code> which is not used and uses <code>url</code> which is not defined.</p> <p>You would normally provide OAuth request parameters with the authorization header rather than the querystring.</p> <p><a href="http://oauth.net/core/1.0/#auth_header_authorization" rel="nofollow">http://oauth.net/core/1.0/#auth_header_authorization</a></p> <p>I would imagine signing the request and setting the Authorization this is something that's being handled inside your OAuth object.</p> <p><strong>To clarify</strong></p> <p>I have used a method like this to sign http requests in my OAuth 1.0a implementation:</p> <pre><code> /// &lt;summary&gt; /// Gets the authorization header. /// &lt;/summary&gt; /// &lt;param name="method"&gt;The method.&lt;/param&gt; /// &lt;param name="url"&gt;The URL of the request.&lt;/param&gt; /// &lt;param name="parameters"&gt;The parameters.&lt;/param&gt; /// &lt;returns&gt;Authorization header&lt;/returns&gt; public string GetAuthorizationHeader(string method, Uri url, NameValueCollection parameters) { parameters.Set("oauth_consumer_key", this.ConsumerKey); parameters.Set("oauth_nonce", this.GetNonce()); parameters.Set("oauth_timestamp", this.GetTimeStamp()); parameters.Set("oauth_version", "1.0"); parameters.Set("oauth_signature_method", "HMAC-SHA1"); string signString = this.GetSignString(method, url, parameters); string signature = this.GetSignature(signString, this.ConsumerSecret, this.tokenSecret); parameters.Set("oauth_signature", signature); StringBuilder authorizationHeader = new StringBuilder(); foreach (string paramKey in parameters.AllKeys) { if (authorizationHeader.Length &gt; 0) { authorizationHeader.Append(", "); } else { authorizationHeader.Append("OAuth "); } authorizationHeader.AppendFormat("{0}=\"{1}\"", paramKey, OAuthHelper.UrlEncode(parameters[paramKey])); } return authorizationHeader.ToString(); } </code></pre> <p><strong>Which I use like this</strong></p> <pre><code> public void SignHttpWebRequest(string token, string tokenSecret, ref HttpWebRequest request) { NameValueCollection parameters = new NameValueCollection(); this.tokenSecret = tokenSecret; parameters.Set("oauth_token", token); request.Headers.Add("Authorization", this.GetAuthorizationHeader(request, parameters)); } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload