I’m new to Twitter API. Using .net c# on WPF platform. I have created an application and already obtained my accesstoken and accesstoken secret for read/write permissions. When I do the following request.GetResponse() returns with unauthorized Exception.
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(resource_url);
request.Headers.Add(“Authorization”, authHeader);
request.Method = “POST”;
request.ContentType = “application/x-www-form-urlencoded”;
using (Stream stream = request.GetRequestStream())
{
byte[] content = ASCIIEncoding.ASCII.GetBytes(postBody);
stream.Write(content, 0, content.Length);
}
WebResponse response = request.GetResponse();
I have gone through the OAuth steps in getting a signature, encrypting it, and creating the authHeader. At this point, I’m not sure if the problem is a bad header or I simply don’t have permissions to tweet to my account. Note that I am simply trying to tweet to my own account (not someone elses), so I have the username and password info.