我为 Android
制作了几个使用 HttpUriRequest 的应用程序和库创建网络请求(例如,我的 droidQuery 库),但是我已经看到一些使用 OkHttp 的新库出现(例如 HttpURLConnection,这意味着非常快)相反。
HttpURLConnection
是否提供比 HttpUriRequest
更快的连接,或者这两个类是否基本等同?使用其中一个的优点和缺点是什么?
最佳答案
这在 Android Dev Blog 上得到了回答:
哪个客户端最好?
Apache HTTP client has fewer bugs on Eclair and Froyo. It is the best choice for these releases.
For Gingerbread and better, HttpURLConnection is the best choice. Its simple API and small size makes it great fit for Android. Transparent compression and response caching reduce network use, improve speed and save battery. New applications should use HttpURLConnection; it is where we will be spending our energy going forward.
关于android - 使用 HttpUriRequest 与 HttpURLConnection 的优缺点是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17981750/