Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
2
Reply
The remote server returned an error: (401) Unauthorized.
gaurav sharma
May 21 2015 8:03 AM
18.4k
Reply
while i am running my c# code then i am getting this error here is my code below
var postBody = "screen_name=" + Uri.EscapeDataString(screen_name) + "&count=" + Uri.EscapeDataString(notweets);//
resource_url += "?" + postBody;
byte[] postDataEncoded = System.Text.Encoding.UTF8.GetBytes(authHeader);
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(resource_url);
request.Accept = "application/xml";
request.Headers.Add("Authorization", authHeader);
request.Method = "GET";
request.ContentType = "application/x-www-form-urlencoded";
request.ContentLength = postDataEncoded.Length;
WebResponse response = request.GetResponse();
string responseData = new StreamReader(response.GetResponseStream()).ReadToEnd();
context.Response.Write(new System.Web.Script.Serialization.JavaScriptSerializer().Serialize(responseData));
context.Response.End();
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
2
)
Next Recommended Forum
The Microsoft Jet database engine cannot open the file
Redirecting URL in ASP.net MVC 5