- GET请求
- POST请求
- PUT请求
- PATCH请求
- DELETE请求
- 缓存
- https(单向)
- https(双向)
<dependency>
<groupId>cn.liberfree</groupId>
<artifactId>http</artifactId>
<version>1.0-RELEASE</version>
</dependency>
<dependency>
<groupId>cn.liberfree</groupId>
<artifactId>sftp</artifactId>
<version>1.1-RELEASE</version>
</dependency>
compile 'cn.liberfree:http:1.0-RELEASE'
compile(group = "cn.liberfree", name = "http", version = "1.0-RELEASE")
GET
POST
DELETE
PUT
PATCH
public static void main(String[] args) {
Request.Response response = RequestBuilder
.build("https://www.sojson.com/open/api/weather/json.shtml")
.addParams("city", "成都")
.get();
logger.info(response.getStatus());
logger.info(response.getContentString());
for (Map.Entry<String, String> entry : response.getHeaders().entrySet()) {
logger.info(entry.getKey()+":"+entry.getValue());
}
}
public static void main(String[] args) {
SftpConfigration sftpConfigration = new SftpConfigration("username", "password","ip", port,null);
SftpConnectionPool connectionPool = new DefaultSftpConnectionPool(sftpConfigration);
System.out.println(SFTPUtil.exist(connectionPool, "/dz/images/8bbd933d-c724-4429-897e-547837e9040a.jpg"));
}