twitter basic authorisation not working?
- by Bunny Rabbit
URL url = new URL("http://twitter.com/statuses/update.xml");
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setDoOutput(true);
String cridentials = new sun.misc.BASE64Encoder().encode((username + ":" + password).getBytes());
conn.setRequestProperty ("Authorization", "Basic " + cridentials);
OutputStreamWriter wr = new OutputStreamWriter(conn.getOutputStream());
wr.write(status);
wr.flush();
wr.close();
why the above code for updating twitter status is not working ? i am running it on google app engine.