Which httpmime version can I use with Android's HttpClient?

Heath Borders picture Heath Borders · Jul 15, 2014 · Viewed 8.1k times · Source

I need to upload files using Android's HttpClient. Unfortunately, Android doesn't include MultipartEntity, so I must using Apache's httpmime library.

I don't want to incur possible conflicts between the Android's HttpClient and the official HttpClient. Also, I don't want to bring in more outside libraries than I have to because I need to keep my method count low.

What version of httpmime will work with Android's HttpClient? All of the questions I've seen recommending httpmime also recommend using Apache's official HttpClient or HttpCore.

(I know I should use Retrofit, but I must use Android's HttpClient for compatibility with other libraries.)

Answer

foxundermon picture foxundermon · Nov 19, 2014
dependencies {
    compile group: 'org.apache.httpcomponents', name: 'httpclient-android', version: '4.3.5'
    compile 'org.apache.httpcomponents:httpmime:4.3.5'
}