| https://www.example.com:8080/path/to/page?name=John&age=30#section1 | scheme: https | host: www.example.com | port: 8080 | path: /path/to/page | query: name=John&age=30 | fragment: section1 | 参数: name=John, age=30 | 常规:最典型的完整 URL,包含 scheme、端口、路径、查询参数和锚点,验证工具能否正确拆解所有组件。 |
| http://localhost:3000/api/users?id=1001&status=active | scheme: http | host: localhost | port: 3000 | path: /api/users | query: id=1001&status=active | 参数: id=1001, status=active | 常规:本地开发场景,host 为 localhost,验证工具对非标准域名的兼容性。 |
| ftp://files.example.com/downloads/file.zip | scheme: ftp | host: files.example.com | path: /downloads/file.zip | query: (空) | 参数: (空) | 边界:非 HTTP/HTTPS 协议(FTP),验证工具是否支持常见非 Web 协议。 |
| https://example.com | scheme: https | host: example.com | path: / (或空) | query: (空) | 参数: (空) | 边界:无路径、无查询、无端口的最简 URL,验证工具对根路径的表示方式(斜杠或空)。 |
| https://example.com/?key=value&key=value2 | scheme: https | host: example.com | path: / | query: key=value&key=value2 | 参数: key=value, key=value2 | 边界:重复参数名(key 出现两次),验证工具是否保留所有同名参数值,而非只取最后一个。 |
| https://example.com/search?q=hello%20world&lang=zh-CN | scheme: https | host: example.com | path: /search | query: q=hello%20world&lang=zh-CN | 参数: q=hello world, lang=zh-CN | 易错:URL 编码的空格(%20)和连字符(zh-CN),验证工具是否自动解码参数值。 |
| https://example.com/path/with/trailing/slash/ | scheme: https | host: example.com | path: /path/with/trailing/slash/ | query: (空) | 参数: (空) | 易错:路径末尾带斜杠,验证工具是否保留尾部斜杠(与无斜杠版本区分)。 |