I have a simple class written in Android Studio:
package com.mysite.myapp;
import org.apache.http.client.HttpClient;
public class Whatever {
public voi
HttpClient is not supported any more in sdk 23. Android 6.0 (API Level 23) release removes support for the Apache HTTP client. You have to use
android {
useLibrary 'org.apache.http.legacy'
.
.
.
and also add below code snippet in your dependency :
//http final solution for web-service (including file uploading)
compile('org.apache.httpcomponents:httpmime:4.3.6') {
exclude module: 'httpclient'
}
compile 'org.apache.httpcomponents:httpclient-android:4.3.5'
It will also help you while you use Use MultipartEntity for File upload.