URL 解析

解析 URL 结构:协议/主机/路径/查询参数/锚点

完整 URL(规范化)
https://user:pass@example.com:8080/path/to/page?id=42&q=%E5%B7%A5%E5%85%B7%E7%AE%B1&sort=desc#section-1

组成部分

protocol (协议)
https:
hostname (主机名)
example.com
port (端口)
8080
host (主机:端口)
example.com:8080
origin (源)
https://example.com:8080
pathname (路径)
/path/to/page
search (查询串)
?id=42&q=%E5%B7%A5%E5%85%B7%E7%AE%B1&sort=desc
hash (锚点)
#section-1
username
user
password
pass

查询参数(3 个)

键 (key)值 (value)
id42
q工具箱
sortdesc

使用浏览器原生 URL API 解析。需输入完整 URL(含协议,如 http:// 或 https://),查询参数自动解码百分号转义。

使用帮助