We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0ea0715 commit 6dd2a86Copy full SHA for 6dd2a86
README.md
@@ -23,6 +23,16 @@
23
24
- 默认会按照下面的优先级自行寻找底层实现,`java 11 HttpClient -> OkHttp3 -> apache HttpClient -> hutool-http`
25
- 也可以自行实现 `com.xkcoding.http.support.Http` 接口,通过 `HttpUtil.setHttp(new MyHttpImpl())` 设置进来
26
+- 可以配置超时时间及代理
27
+
28
+```java
29
+HttpConfig config = new HttpConfig();
30
+config.setProxy(new Proxy(Proxy.Type.HTTP, new InetSocketAddress("127.0.0.1", 10080)));
31
+config.setTimeout(15000);
32
+HttpUtil.setConfig(config);
33
+String s = HttpUtil.get("https://www.google.com");
34
+System.out.println("s = " + s);
35
+```
36
37
## TODO
38
0 commit comments