Skip to content

Commit edbce39

Browse files
committed
📝 更新文档
1 parent 7591e81 commit edbce39

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

README.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,11 @@
2424
- 默认会按照下面的优先级自行寻找底层实现,`java 11 HttpClient -> OkHttp3 -> apache HttpClient -> hutool-http`
2525
- 也可以自行实现 `com.xkcoding.http.support.Http` 接口,通过 `HttpUtil.setHttp(new MyHttpImpl())` 设置进来
2626
- 可以配置超时时间及代理
27-
2827
```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);
28+
HttpUtil.setConfig(HttpConfig.builder()
29+
.timeout(Constants.DEFAULT_TIMEOUT)
30+
.proxy(new Proxy(Proxy.Type.HTTP, new InetSocketAddress("127.0.0.1", 10080)))
31+
.build());
3332
String s = HttpUtil.get("https://www.google.com");
3433
System.out.println("s = " + s);
3534
```

0 commit comments

Comments
 (0)