Friday, October 29, 2010

The remote server returned an error: (401) Unauthorized. twitter api

 

Server Error in '/twitweb' Application.

The remote server returned an error: (401) Unauthorized.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Net.WebException: The remote server returned an error: (401) Unauthorized.

Source Error:

Line 271:            finally Line 272:            { Line 273:                webRequest.GetResponse().GetResponseStream().Close(); Line 274:                responseReader.Close(); Line 275:                responseReader = null;

Source File: c:\Inetpub\wwwroot\twitweb\App_Code\oAuthTwitter.cs    Line: 273

Stack Trace:

[WebException: The remote server returned an error: (401) Unauthorized.]    System.Net.HttpWebRequest.GetResponse() +1126    oAuthExample.oAuthTwitter.WebResponseGet(HttpWebRequest webRequest) in c:\Inetpub\wwwroot\twitweb\App_Code\oAuthTwitter.cs:273    oAuthExample.oAuthTwitter.WebRequest(Method method, String url, String postData) in c:\Inetpub\wwwroot\twitweb\App_Code\oAuthTwitter.cs:244    oAuthExample.oAuthTwitter.oAuthWebRequest(Method method, String url, String postData) in c:\Inetpub\wwwroot\twitweb\App_Code\oAuthTwitter.cs:199    oAuthExample.oAuthTwitter.AccessTokenGet(String authToken, String oauthVerifier) in c:\Inetpub\wwwroot\twitweb\App_Code\oAuthTwitter.cs:103    Default6.Page_Load(Object sender, EventArgs e) in c:\Inetpub\wwwroot\twitweb\Default6.aspx.cs:32    System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +25    System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +42    System.Web.UI.Control.OnLoad(EventArgs e) +132    System.Web.UI.Control.LoadRecursive() +66    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2428 


Version Information: Microsoft .NET Framework Version:2.0.50727.3615; ASP.NET Version:2.0.50727.3614
 
if you are using same message again 2 times you will get this error.change your message and then try.

1 comment:

des said...

pls elaborate further!