Note that there are some explanatory texts on larger screens.

plurals
  1. POCapturing 401 errors with Fiddler - Twitter OAUTH 1.0
    text
    copied!<p>I'm trying to view the HTTP request being sent/received to twitter. I tried downloading fiddler4 but it's not registering the 401 error and I'm only receiving the 500 page error. Any ideas on how to view the request being sent so I can trouble shoot the reason?</p> <p>I tried viewing the site as localhost, 127.0.0.1, and machinename.</p> <pre><code>Dim oAuthRequest As New Dictionary(Of String, String) oAuthRequest.Add("resource_url", "https://api.twitter.com/oauth/request_token") oAuthRequest.Add("oauth_callback", Server.UrlEncode("https://www.site.com/callback/")) oAuthRequest.Add("oauth_consumer_key", "xxxxxxxx") oAuthRequest.Add("oauth_nonce", Convert.ToBase64String(New ASCIIEncoding().GetBytes(DateTime.Now.Ticks.ToString()))) oAuthRequest.Add("oauth_signature_method", "HMAC-SHA1") oAuthRequest.Add("oauth_timestamp", CInt((DateTime.UtcNow - New DateTime(1970, 1, 1)).TotalSeconds).ToString) oAuthRequest.Add("oauth_token", "authorization_code") Dim baseFormat As String = "oauth_callback=""{0}""&amp;oauth_consumer_key=""{1}""&amp;oauth_nonce=""{2}""&amp;oauth_signature_method=""HMAC-SHA1""&amp;oauth_timestamp=""{3}""&amp;oauth_version=""" &amp; Uri.EscapeDataString("1.0") &amp; """" Dim baseString As String = String.Format(baseFormat, oAuthRequest("oauth_callback"), oAuthRequest("oauth_consumer_key"), oAuthRequest("oauth_nonce"), oAuthRequest("oauth_timestamp")) baseString = String.Concat("POST&amp;", Uri.EscapeDataString(oAuthRequest("resource_url")), "&amp;", Uri.EscapeDataString(baseString)) oAuthRequest.Add("oauth_signature", SHA1Base64Hash("xxxxxxx&amp;", baseString)) Dim authHeaderFormat As String = "OAuth oauth_callback=""{0}"",oauth_consumer_key=""{1}"",oauth_nonce=""{2}"",oauth_signature=""{3}"",oauth_signature_method=""HMAC-SHA1"",oauth_timestamp=""{4}"",oauth_version=""1.0""" Dim authHeader As String = String.Format(authHeaderFormat, Uri.EscapeDataString(oAuthRequest("oauth_callback")), Uri.EscapeDataString(oAuthRequest("oauth_consumer_key")), Uri.EscapeDataString(oAuthRequest("oauth_nonce")), Uri.EscapeDataString(oAuthRequest("oauth_signature")), Uri.EscapeDataString(oAuthRequest("oauth_timestamp"))) ServicePointManager.Expect100Continue = False Dim request As HttpWebRequest = CType(WebRequest.Create(oAuthRequest("resource_url")), HttpWebRequest) request.Headers.Add("Authorization", authHeader) request.Method = "POST" request.ContentType = "application/x-www-form-urlencoded" Try Dim response As WebResponse = request.GetResponse() Catch ex As Exception Text.text = ex.Message End Try </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