URL 对比
参数差异对比
URL 1
URL 2
💡 使用说明
什么是 URL 对比?
URL 对比工具用于比较两个 URL 的查询参数差异,帮助快速识别新增、删除、修改和相同的参数。
差异类型
- 新增: URL 2 中有但 URL 1 中没有的参数
- 删除: URL 1 中有但 URL 2 中没有的参数
- 修改: 两个 URL 都有但值不同的参数
- 相同: 两个 URL 中键值都相同的参数
应用场景
- 对比 API 请求参数的变化
- 调试 URL 参数差异问题
- 分析不同环境的 URL 配置
- 版本迁移时的参数对比
注意事项
- 仅对比查询参数,不对比基础 URL
- 参数值区分大小写
- 支持多值参数的对比
- 参数顺序不影响对比结果
基础 URL 对比
URL 1:
https://example.com/api/users
URL 2:
https://example.com/api/users
✓ 基础 URL 相同
差异汇总
新增1
删除1
修改2
相同1
+ 新增参数 (1)
status=verified
− 删除参数 (1)
filter=active
~ 修改参数 (2)
−page=1
+page=2
−sort=name
+sort=email
= 相同参数 (1)
limit=10
JSON 输出
{
"url1": {
"full": "https://example.com/api/users?page=1&limit=10&sort=name&filter=active",
"base": "https://example.com/api/users",
"origin": "https://example.com",
"pathname": "/api/users",
"search": "?page=1&limit=10&sort=name&filter=active",
"hash": ""
},
"url2": {
"full": "https://example.com/api/users?page=2&limit=10&sort=email&status=verified",
"base": "https://example.com/api/users",
"origin": "https://example.com",
"pathname": "/api/users",
"search": "?page=2&limit=10&sort=email&status=verified",
"hash": ""
},
"baseEqual": true,
"originEqual": true,
"pathnameEqual": true,
"hashEqual": true,
"added": {
"status": "verified"
},
"removed": {
"filter": "active"
},
"changed": {
"page": {
"from": "1",
"to": "2"
},
"sort": {
"from": "name",
"to": "email"
}
},
"same": {
"limit": "10"
}
}