Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
MultipartEntity implementation for Android to be used with Apache HttpClient library
Branch: master
Pull request Compare This branch is even with cleverua:master.

README.rdoc

DESCRIPTION

The Android API provides a cool Apache HttpClient library. However for some reason MultipartEntity is not available in Android API. This project solves this by introducing a custom MultipartEntity.

Usage

The usage is similar to any other HttpEntity you would normally use with HttpClient:

HttpClient httpclient = new DefaultHttpClient();
HttpPost httppost = new HttpPost("http://www.yourhost.com");
MultipartEntity entity = new MultipartEntity();
entity.addPart(new StringPart("name", "Vitaliy"));
File imageFile = // .. get your image file
entity.addPart(new FilePart("picture", imageFile, null, "image/jpeg"));
httppost.setEntity(entity);
HttpResponse httpResponse = httpclient.execute(httppost);

EXAMPLES

To see an example please launch the “MultipartEntity Sample” application in Android device emulator.

Something went wrong with that request. Please try again.