I'm trying to post a Twitter update using Javascript - here's my code:
xhr.open("POST", "http://twitter.com/statuses/
update.json", true);
xhr.setRequestHeader('Authorization', 'Basic ' + b64unpw);
xhr.setRequestHeader("Content-type", "application/x-www-
form-urlencoded");
xhr.setRequestHeader("Content-length", posttext.length);
xhr.setRequestHeader("Connection", "close");
xhr.setRequestHeader("Accept-encoding", "text/plain");
xhr.send("status=" + encodeURIComponent("top & bottom"));
The tweet is posted but it looks like this: top %26 bottom
This works fine:
curl --basic --user onetwthree:longlongpw --data status='top %26
bottom' http://twitter.com/statuses/update.json
so what's the problem with my javascript?
To unsubscribe from this group, send email to
twitter-development-talk+unsubscribegooglegroups.com or reply to this email
with the words "REMOVE ME" as the subject.