- 授权协议: 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");
}
});
Learning jQuery
Jonathan Chaffer、Karl Swedberg / Packt Publishing / 2007-7-7 / GBP 24.99
jQuery is a powerful JavaScript library that can enhance your websites regardless of your background. In this book, creators of the popular jQuery learning resource, learningquery.com, share the......一起来看看 《Learning jQuery》 这本书的介绍吧!
