# url 库 ## 功能 url 标准库用于 URL 编码、解码、解析、查询参数读取和对象构建 URL。 ## API 列表 | API | 说明 | | ------ | ------ | | [url.encode](/zh-hans/docs/url/encode) | 对当前文本做 URL 组件百分号编码。 | | [url.decode](/zh-hans/docs/url/decode) | 对当前文本做百分号解码。 | | [url.parse](/zh-hans/docs/url/parse) | 解析当前 URL 为对象。 | | [url.query](/zh-hans/docs/url/query) | 读取当前 URL 的查询参数对象。 | | [url.build](/zh-hans/docs/url/build) | 从对象配置构建 URL 字符串。 | | [url.to_string](/zh-hans/docs/url/to_string) | 返回当前 URL 原始文本。 | ## 示例 ```bt result = url('https://btlang.org/zh-hans/docs/index?q=BT%20Lang').query().q // 输出:BT Lang print result ``` ## 注意事项 - encode/decode 处理 URL 组件文本;完整 URL 解析请使用 parse。