I’m making a small app in Adobe Air which I need to interact with the Github Gist API. However I’m kind of stuck.
If you’re not familiar with Adobe Air you can still help, the XMLHttpRequest javascript object can do cross domain requests, as there is no domain as such. So theres nothing Adobe Air specific here.
Where I’m stuck is I think I need to authenticate myself then make the POST. I just don’t understand it
The problem with your script is that though you’re sending a POST method, you’re adding the data in the URL as though it were a GET. You just need to change
xmlhttp.send(NULL)toxmlhttp.send(data), wheredatais the query data you were appending to thegistsURL before (including the file and authentication information).As a simple example, here’s an excerpt from a bash script creating a new gist: