- 授权协议: GPL
- 开发语言: Java
- 操作系统: 跨平台
- 软件首页: https://git.oschina.net/icecooly/FastHttpClient
- 软件文档: https://git.oschina.net/icecooly/FastHttpClient/blob/master/README.md
软件介绍
FastHttpClient 是简易封装 OkHttp 的工具(需要jdk8以上),高效使用http(s) post get 。
用法
1.同步的get
FastHttpClient.get().
url(url).
addParams("userName", "icecool").
addParams("password", "111111").
build().
execute();2.同步的post
FastHttpClient.post().
url(url).
addParams("userName", "icecool").
addParams("password", "111111").
build().
execute();3.异步的get
FastHttpClient.get().
url(url).
addParams("userName","icecool").
addParams("password", "111111").
build().
executeAsync(new Callback() {
@Override
public void onFailure(Call call, Exception e, int id) {
//TODO
}
@Override
public void onResponse(Call call,Response response, int id) {
try {
System.out.println(response.body().string());
} catch (IOException e) {
}
}
});4.异步的post
FastHttpClient.post().
url(url).
addParams("userName","icecool").
addParams("password", "111111").
build().
executeAsync(new Callback() {
@Override
public void onFailure(Call call, Exception e, int id) {
//TODO
}
@Override
public void onResponse(Call call,Response response, int id) {
try {
System.out.println(response.body().string());
} catch (IOException e) {
}
}
});5.异步下载文件
FastHttpClient.get().
url("http://e.hiphotos.baidu.com/image/pic/item/faedab64034f78f0b31a05a671310a55b3191c55.jpg").
build().addNetworkInterceptor(new DownloadFileInterceptor(){
@Override
public void updateProgress(long downloadLenth, long totalLength, boolean isFinish) {
System.out.println("updateProgress downloadLenth:"+downloadLenth+
",totalLength:"+totalLength+",isFinish:"+isFinish);
}
}).
executeAsync(new DownloadFileCallback("/tmp/tmp.jpg") {//save file to /tmp/tmp.jpg
@Override
public void onFailure(Call call, Exception e, int id) {
e.printStackTrace();
}
@Override
public void onSuccess(Call call, File file, int id) {
super.onSuccess(call, file, id);
System.out.println("filePath:"+file.getAbsolutePath());
}
@Override
public void onSuccess(Call call, InputStream fileStream, int id) {
System.out.println("onSuccessWithInputStream");
}
});
Thread.sleep(50000);6.上传文件
byte[] imageContent=FileUtil.getBytes("/tmp/test.png");
response = FastHttpClient.post().
url(url).
addFile("file1", "a.txt", "123").
addFile("file2", "b.jpg", imageContent).
build().
connTimeOut(10000).
execute();
System.out.println(response.body().string());7.https get
Response response = FastHttpClient.get().url("https://kyfw.12306.cn/otn/").
build()
.execute();
System.out.println(response.body().string());8.https post
Response response = FastHttpClient.post().url("https://kyfw.12306.cn/otn/").
build()
.execute();
System.out.println(response.body().string());
数据库系统概念
Abraham Silberschatz、Henry F. Korth、S. Sudarshan / 杨冬青、马秀莉、唐世渭 / 机械工业 / 2006-10-01 / 69.50元
本书是数据库系统方面的经典教材之一。国际上许多著名大学包括斯坦福大学、耶鲁大学、得克萨斯大学、康奈尔大学、伊利诺伊大学、印度理工学院等都采用本书作为教科书。我国也有许多所大学采用本书以前版本的中文版作为本科生和研究生的数据库课程的教材和主要教学参考书,收到了良好的效果。 本书调整和新增内容:调整了第4版的讲授顺序。首先介绍SQL及其高级特性,使学生容易接受数据库设计的概念。新增数据库设计的专......一起来看看 《数据库系统概念》 这本书的介绍吧!
