I want to upload some data from an Android application to Pachube.
[Update: For people reading this in 2013, “Pachube” became “Cosm”, which is now “Xively”.]
This hurl is provided by their documentation as an example.
How can I achieve this with Android’s implementation of HttpPut (or HttpPost)?
I don’t really want to have to add any extra libraries, as I want to keep the application as small as possible.
I already have a JSONObject with my data in it.
Here is some pseudocode. Note that you shouldn’t send form url encoded data in a PUT request, as it may break server side OAuth (if being used):