Closed GoogleCodeExporter closed 8 years ago
You are right. The multipart post method isn't supported by the auth framework.
Ideally it should be rewritten to use the apache http client so all features
that http request have will work on multipart post.
Will take a look at your code and see what we can do to support this.
Really appreciate your contribution.
Original comment by tinyeeliu@gmail.com
on 28 Jun 2012 at 10:53
0.23.8 released that fix twitter multipart photo upload issue:
http://code.google.com/p/android-query/downloads/list
Example:
private String UPLOAD_IMAGE = "http://www.vikispot.com/z/images/vikispot/android-w.png";
public void auth_twitter_upload(){
File file = aq.getCachedFile(UPLOAD_IMAGE);
if(file == null){
aq.cache(UPLOAD_IMAGE, 0);
return;
}
AQUtility.debug("upload file:" + file.length());
TwitterHandle handle = new TwitterHandle(this, CONSUMER_KEY, CONSUMER_SECRET);
String url = "https://upload.twitter.com/1/statuses/update_with_media.json";
Map<String, Object> params = new HashMap<String, Object>();
params.put("status", "Testing Status Update with AndroidQuery");
params.put("media[]", file);
aq.auth(handle).progress(R.id.progress).ajax(url, params, JSONObject.class, this, "twitterCb2");
}
Original comment by tinyeeliu@gmail.com
on 18 Aug 2012 at 4:59
[deleted comment]
you can sneak-peek into tinyeeliu implementation, although i havent seen new
version of aquery, i guess it works.
I can remember that with normal OAuth you should sign all post paremeters, but
in twitter case, you should watch which parameters are signed.
At the end, use latest Android Query, and use code written above.
Original comment by Tomislav...@gmail.com
on 27 Aug 2012 at 1:05
Original issue reported on code.google.com by
Tomislav...@gmail.com
on 27 Jun 2012 at 11:11Attachments: