I\'m upgrading an app to API 23 where org.apache.http
is deprecated.
My current (deprecated) code looks like this:
HttpClient httpClient
If you change your compileSdkVersion
to 21, your app will compile cleanly. That being said, there are reasons why Google is backing away from the built-in HttpClient implementation, so you probably should pursue some other library. That
"some other library" could be:
HttpUrlConnection
, though as you have found, its API leaves something to be desiredIn particular, OkHttp seems to have a pretty good API for posting a file and posting a multipart form, which should be similar to what your HttpClient code is doing.