Skip to content

Releases: gudaoxuri/dew-common

2.0.0

12 May 13:18
Compare
Choose a tag to compare

.Features

  • JDK升级到11
  • 添加对JDK Http模块(java.net.http.HttpClient)的支持

1.3.0

01 Jun 12:46
Compare
Choose a tag to compare

Support http operations

Http操作($.http)

// get
String result = $.http.get("https://httpbin.org/get");
// get 带 head
result = $.http.get("https://httpbin.org/get", new HashMap<String, String>() {{
    put("Customer-A", "AAA");
    put("Accept", "json");
}});
// get 包含 head、Content-Type、编码、超时等信息
result = $.http.get("https://httpbin.org/get", new HashMap<String, String>() {{
    put("Customer-A", "AAA");
    put("Accept", "json");
}}, "application/json; charset=utf-8", "utf-8", 5000);
// delete
result = $.http.delete("https://httpbin.org/delete");
Assert.assertEquals("httpbin.org", $.json.toJson(result).get("headers").get("Host").asText());
// post - data
result = $.http.post("https://httpbin.org/post", "some data");
// post - form
result = $.http.post("https://httpbin.org/post", new HashMap<String, Object>() {{
    put("a", "1");
}}, "application/x-www-form-urlencoded");
// post - file
result = $.http.post("https://httpbin.org/post", new File(this.getClass().getResource("/").getPath() + "conf1.json"));
// put - data
result = $.http.put("https://httpbin.org/put", "some data");
// put - form
result = $.http.put("https://httpbin.org/put", new HashMap<String, Object>() {{
    put("a", "1");
}}, "application/x-www-form-urlencoded");
// put - file
result = $.http.put("https://httpbin.org/put", new File(this.getClass().getResource("/").getPath() + "conf1.json"));
// put 返回带 head的内容,同样还有getWithHead、postWithHead、deleteWtihHead
HttpHelper.WrapHead wrapHead = $.http.putWithHead("https://httpbin.org/put", new File(this.getClass().getResource("/").getPath() + "conf1.json"));
// head
Map<String, String> head = $.http.head("https://httpbin.org/get");
// options
head = $.http.options("https://httpbin.org/get");

1.2.0

31 May 07:05
Compare
Choose a tag to compare

Use $ as the portal for core operations.

1.1.1

28 May 12:22
Compare
Choose a tag to compare
  1. 完善文档
  2. 添加一些特性

1.0.0

15 May 09:17
Compare
Choose a tag to compare

功能

  1. Json与Java对象转换(JsonHelper)
  2. Java Bean操作(BeanHelper)
  3. Java Class扫描操作(ClassScanHelper)
  4. Shell脚本操作(ShellHelper)
  5. 加解密(EncryptHelper)
  6. 响应处理模型(Resp)
  7. 定时器(TimerHelper)
  8. 常用时间处理(TimeHelper)
  9. 主流文件MIME整理(MimeHelper)
  10. 通用拦截器栈(DewInterceptorProcessor)