Multipart Form Posting in Android
Naturally the wealth of apps on Android and other mobile devices require some kind of network interface for consumption of data and communicating details back to servers. Android - being built with Java - allows you to use the org.apache.http.client.HttpClient which is great until you want to send an image/file or anything else in a multi-part form.
The version of HttpClient in Android (2.2 - not developing against other versions yet) does not have support for multi-part forms. You could write content as separate entities/directly to the stream but that can soon get messy.
To make things simpler, grab the HttpClient (4.1.3) jar from Apache, drop into your Android project build path and do the following in your request/response handler:
Leave a Comment
Your email address will not be published. Required fields are marked *