Skip to content

Instantly share code, notes, and snippets.

@kwhinnery
Created July 7, 2009 14:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kwhinnery/142118 to your computer and use it in GitHub Desktop.
Save kwhinnery/142118 to your computer and use it in GitHub Desktop.
//Make XHR request to post picture
function postPic(pic) {
var query = 'https://twitpic.com/api/uploadAndPost';
var xhr = Titanium.Network.createHTTPClient();
xhr.onreadystatechange = function() {
if (this.readyState == 4) {
notify('Picture posted sucessfully!');
}
};
xhr.open('POST',query);
xhr.send({
media:pic,
username: $("#username").val(),
password: $("#password").val(),
message: $("#message").val()
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment