- 授权协议: MIT
- 开发语言: Java Objective-C PHP Python Ruby C# .NET JavaScript
- 操作系统: 跨平台
- 软件首页: http://unirest.io/
- 软件文档: http://unirest.io/
软件介绍
Unirest 是一个轻量级的 HTTP 请求库,涵盖 Node、Ruby、Java、PHP、Python、Objective-C、.NET 等多种语言。可发起 GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS 请求。
Java 版本的示例代码:
HttpResponse<JsonNode> jsonResponse = Unirest.post("http://httpbin.org/post")
.header("accept", "application/json")
.field("parameter", "value")
.field("foo", "bar")
.asJson();
//参数处理
Unirest.get("http://httpbin.org/{method}")
.routeParam("method", "get")
.field("name", "Mark")
.asJson();
//异步请求
Future<HttpResponse<JsonNode>> future = Unirest.post("http://httpbin.org/post")
.header("accept", "application/json")
.field("param1", "value1")
.field("param2", "value2")
.asJsonAsync(new Callback<JsonNode>() {
public void failed(UnirestException e) {
System.out.println("The request has failed");
}
public void completed(HttpResponse<JsonNode> response) {
int code = response.getCode();
Map<String, String> headers = response.getHeaders();
JsonNode body = response.getBody();
InputStream rawBody = response.getRawBody();
}
public void cancelled() {
System.out.println("The request has been cancelled");
}
});
Nine Algorithms That Changed the Future
John MacCormick / Princeton University Press / 2011-12-27 / GBP 19.95
Every day, we use our computers to perform remarkable feats. A simple web search picks out a handful of relevant needles from the world's biggest haystack: the billions of pages on the World Wide Web.......一起来看看 《Nine Algorithms That Changed the Future》 这本书的介绍吧!
