依赖

<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();
Last modification:October 30th, 2020 at 04:05 pm
如果觉得这篇技术文章对你有用,请随意赞赏