社区
Android
帖子详情
Android的RequestParams的问题
liaokm168
2015-10-05 09:23:19
如图所示,不带File[]数组吗?
搜索有如下的参数的啊:
File[] files = { new File("pic.jpg"), new File("pic1.jpg") }; // Ordered collection
params.put("files", files); // url params: "files[]=pic.jpg&files[]=pic1.jpg"
但是,却不行?
...全文
366
1
打赏
收藏
Android的RequestParams的问题
如图所示,不带File[]数组吗? 搜索有如下的参数的啊: File[] files = { new File("pic.jpg"), new File("pic1.jpg") }; // Ordered collection params.put("files", files); // url params: "files[]=pic.jpg&files[]=pic1.jpg" 但是,却不行?
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
1 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
liaokm168
2015-10-07
打赏
举报
回复
已解决,是jar版本问题!
android
-async-http 源码
Asynchronous Http Client for
Android
Build Status An asynchronous, callback-based Http client for
Android
built on top of Apache's HttpClient libraries. Changelog See what is new in version 1.4.9 released on 19th September 2015 https://github.com/loopj/
android
-async-http/blob/1.4.9/CHANGELOG.md Javadoc Latest Javadoc for 1.4.9 release are available here (also included in Maven repository): https://loopj.com/
android
-async-http/doc/ Features Make asynchronous HTTP
request
s, handle responses in anonymous callbacks HTTP
request
s happen outside the UI thread
Request
s use a threadpool to cap concurrent resource usage GET/POST
params
builder (
Request
Params
) Multipart file uploads with no additional third party libraries Tiny size overhead to your application, only 60kb for everything Automatic smart
request
retries optimized for spotty mobile connections Automatic gzip response decoding support for super-fast
request
s Optional built-in response parsing into JSON (JsonHttpResponseHandler) Optional persistent cookie store, saves cookies into your app's SharedPreferences Examples For inspiration and testing on device we've provided Sample Application. See individual samples here on Github To run Sample application, simply clone the repository and run this command, to install it on connected device gradle :sample:installDebug Maven You can now integrate this library in your project via Maven. There are available two kind of builds. releases, maven central https://repo1.maven.org/maven2/com/loopj/
android
/
android
-async-http/ Maven URL: https://repo1.maven.org/maven2/ GroupId: com.loopj.
android
ArtifactId:
android
-async-http Version: 1.4.9 Packaging: JAR or AAR Gradle repositories { maven { mavenCentral() } } dependencies { compile 'com.loopj.
android
:
android
-async-http:1.4.9' } development snapshots https://oss.sonatype.org/content/repositories/snapshots/com/loopj/
android
/
android
-async-http/ Maven URL: https://oss.sonatype.org/content/repositories/snapshots/ GroupId: com.loopj.
android
ArtifactId:
android
-async-http Version: 1.5.0-SNAPSHOT Packaging: JAR or AAR Gradle repositories { maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' } } dependencies { compile 'com.loopj.
android
:
android
-async-http:1.5.0-SNAPSHOT' } Documentation, Features and Examples Full details and documentation can be found on the project page here: https://loopj.com/
android
-async-http/
Android
Asynchronous Http Client的用法实例
// 1.创建异步请求的客户端对象 AsyncHttpClient client = new AsyncHttpClient(); // 2.定义请求的地址 String url = "http://192.168.1.1:8080/GourmetOrderServer/loginServlet?name=jun&paw=123456"; // 3.创建请求参数的封装的对象
Request
Params
params
= new
Request
Params
(); // 4.设置请求的参数名和参数值
params
.put("username", userName); // 5.设置请求的参数名和参数
params
.put("userpass", userPass); //6.执行post方法 client.post(url,
params
, new AsyncHttpResponseHandler() { public void onSuccess(int statusCode, Header[] headers, byte[] responseBody) { if (statusCode == 200) { } } public void onFailure(int statusCode, Header[] headers, byte[] responseBody, Throwable error) { } }); } 其他有什么
问题
或者想具体了解详细说明,可以参考官网 http://loopj.com/
android
-async-http/ 其他参考链接 http://blog.csdn.net/redarmy_chen/article/details/26980613
Android
异步http请求工具包及源码
开源的异步http连接工具类源码. 示例代码: public class TwitterRestClient { private static final String BASE_URL = "http://api.twitter.com/1/"; private static AsyncHttpClient client = new AsyncHttpClient(); public static void get(String url,
Request
Params
params
, AsyncHttpResponseHandler responseHandler) { client.get(getAbsoluteUrl(url),
params
, responseHandler); } public static void post(String url,
Request
Params
params
, AsyncHttpResponseHandler responseHandler) { client.post(getAbsoluteUrl(url),
params
, responseHandler); } private static String getAbsoluteUrl(String relativeUrl) { return BASE_URL + relativeUrl; } }
XCHttpClient:
Android
Http网络开发框架(非第三方)
XCHttpClient
Android
Http网络开发框架(非第三方) 该框架是本人基于HttpConnection开发的一套 类似于
android
-async-http 和Volley那样的快速网络开发框架 支持同步,异步方式的请求; 支持GET,POST请求; 使用方法: 1、请求文本内容: String url ="";
Request
Params
params
= new
Request
Params
();
params
.put("a","3");
params
.put("b",64); XCHttpClient.getInstance().post(url,
params
, new TextResponseCallback() { @Override public void onSuc
Android
-async-http 源码及jar包
Async-http是一款国外的开源框架,作者是loopj。是基于Apache HttpClient库的。可以方便快速高效的进行网络数据请求 和发送,文件下载和上传。 特点: 清晰的网络请求回调 请求使用ThreadPool,限制并发资源使用情况 GET / POST基于参数构 建使用(
Request
Params
),方便 Multipart 文件上传,大数据上传下载 自动智能请求重试,优化了质量不一的移动连接
Android
80,348
社区成员
91,289
社区内容
发帖
与我相关
我的任务
Android
移动平台 Android
复制链接
扫一扫
分享
社区描述
移动平台 Android
android
android-studio
androidx
技术论坛(原bbs)
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章