看到Android api 23中 抛弃了HttpCclient ,试了一下,发现声明HttpClient时无法导入相应的Apache包。
但看到好多源码中还在使用,是需要导入第三方库吗?
参见 https://hc.apache.org/httpcomponents-client-4.5.x/android-port.html,API 23 以后 Apache 官方也放弃了 HttpClient 对 Android 的支持,但 Apache 推荐可以使用第三方的 包:http://mvnrepository.com/artifact/cz.msebera.android/httpclient。
Gradle:'cz.msebera.android:httpclient:4.4.1.1'