什么是Android上最强大的HTTP库? [英] What is the most robust HTTP library for android?

查看:382
本文介绍了什么是Android上最强大的HTTP库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在寻找处理HTTP POST库,多部分等是否有一个事实上的标准库,使这些要求更容易在Android?

I'm looking for a library that handles HTTP POST, multipart etc. Is there a de-facto standard library to make these requests easier on android?

推荐答案

看看 DroidFu ,和特别是DroidFu HTTP组件的。他们围绕Apache的百科全书HTTP的东西相当薄的包装,但他们最适合需要pretty的好。它包含了一些美好得像可选的HTTP和模型缓存,甚至还有为什么不是这个内置到平台的东西,如GZip压缩。 (旁白: android.net.AndroidHttPClient 是pretty的良好的升级,当你需要下拉多一点的控制,但它的Andr​​oid 2.2+只,是相当underdocumented)。

Take a look at DroidFu, and in particular the DroidFu HTTP components. They're a fairly thin wrapper around the Apache Commons HTTP stuff, but they fit most needs pretty well. It includes some niceties like optional HTTP and model caching, and even "why isn't this built in to the platform" stuff like GZip. (An aside: android.net.AndroidHttPClient is a pretty good upgrade to the older stock DefaultHttpClient stuff when you need to drop down for a little more control, but it's Android 2.2+ only and is fairly underdocumented).

如果你只需要多部分用最少的麻烦,你可以尝试 android_multipart_post ,虽然我从来没有试了一下。

If you just need multipart with a minimum hassle, you can try android_multipart_post, though I've never tried it.

编辑:

DroidFu现已停产。这些天来,如果我开始一个新项目,我几乎可以肯定,使用排球,与 OKHttp 如果我需要更多的控制(你甚至可以用OKHttp作为传输层的凌空抽射,如果你想两者都做)。

DroidFu is now discontinued. These days if I was starting a new project I'd almost certainly use Volley, with OKHttp if I needed more control (you can even use OKHttp as the transport layer for volley if you want to do both).

这篇关于什么是Android上最强大的HTTP库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆