Hi. I tried to update my background using oath. But i have 401
unauthorized error
var credentials = new OAuthCredentials
{
Type = OAuthType.ProtectedResource,
SignatureMethod = OAuthSignatureMethod.HmacSha1,
ParameterHandling =
OAuthParameterHandling.HttpAuthorizationHeader,
ConsumerKey = _consumerKey,
ConsumerSecret = _consumerSecret,
Token = _oauth_access_token,
TokenSecret = _oauth_access_token_secret,
Version = "1.0",
};
var client = new RestClient
{
Authority = "http://api.twitter.com",
Credentials = credentials,
};
var request = new RestRequest
{
Path = "1/account/
update_profile_background_image.json",
Method = WebMethod.Post
};
var webClient = new WebClient();
byte[] imageBytes = webClient.DownloadData("http://
www.google.com/images/logos/ps_logo2.png");
request.AddFile("file1", "ps_logo2.png", new
MemoryStream(imageBytes), "image/png");
RestResponse postResponse = client.Request(request);
Can you help me?
--
Twitter developer documentation and resources: http://dev.twitter.com/doc
API updates via Twitter: http://twitter.com/twitterapi
Issues/Enhancements Tracker: http://code.google.com/p/twitter-api/issues/list
Change your membership to this group:
http://groups.google.com/group/twitter-development-talk