oauth - Using twitter to get bearer token -


i'm using following code return bearer token keep getting

"the remote server returned error: (500) internal server error" on line "webresponse response = request.getresponse();"

 webrequest request = webrequest.create("https://api.twitter.com/oauth2/token");      string consumerkey = "31111111111111111111";     string consumersecret = "1111111111111111111111a";     string consumerkeyandsecret = string.format("{0}:{1}", consumerkey, consumersecret);      request.method = "post";        request.headers.add("authorization", string.format("basic {0}", convert.tobase64string(encoding.unicode.getbytes(consumerkeyandsecret))));      request.contenttype = "application/x-www-form-urlencoded;charset=utf-8";      string postdata = "grant_type=client_credentials";     byte[] bytearray = encoding.utf8.getbytes(postdata);     request.contentlength = bytearray.length;     stream datastream = request.getrequeststream();     datastream.write(bytearray, 0, bytearray.length);     datastream.close();      webresponse response = request.getresponse(); 

any advise amazing

in past have used tweetsharp uses twitter's 1.1 api. you'd better using twitter calls.

tweetsharp github: https://github.com/danielcrenna/tweetsharp

if require example or need, let me know.


Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -