As CommonsWare already said in its answer, the entire http client package is deprecated with the version of the tool for Android 23.0.0. Therefore, we are better off using some other API, such as HttpUrlConnection or any third- HttpUrlConnection library, such as Volley or okHttp or retrofit .
But if you still need all the packages; you can add the following dependency to your gradle script application module:
dependencies { compile 'org.jbundle.util.osgi.wrapped:org.jbundle.util.osgi.wrapped.org.apache.http.client:4.1.2' }
and don't forget to add mavenCentral() to your gradle script project:
allprojects { repositories { jcenter() mavenCentral() } }
After adding these; Just sync your project with gradle. And you can import and use these APIs again.
UPDATE:
Thanks to @rekire for mentioning this in a comment. Here I also add that instead of using the above dependency, you can simply add useLibrary 'org.apache.http.legacy' to your Android DSL module for gradle script. Add it as shown below:
android { compileSdkVersion 23 buildToolsVersion "23.0.2" useLibrary 'org.apache.http.legacy' //rest things... }
Hope this helps someone.
source share