Java实现URL参数拼接案例
依赖
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-all</artifactId>
<version>5.4.6</version>
</dependency>
代码示例// https://www.hutool.cn/aaa/bbb?ie=UTF-8&wd=test
// https://www.hutool.cn/aaa/bbb?ie=UTF-8&wd=test
String buildUrl = UrlBuilder.create()
.setScheme("https")
.setHost("www.hutool.cn")
.addPath("/aaa").addPath("bbb")
.addQuery("ie", "UTF-8")
.addQuery("wd", "test")
.build();
当前页面是本站的「Google AMP」版。查看和发表评论请点击:完整版 »