python - 什么是 urlparse 返回的 scheme://netloc/path;parameters?query#fragment 中的“参数”以及它的使用位置?
问题描述
https://docs.python.org/3/library/urllib.parse.html#url-parsing
将 URL 解析为六个组件,返回一个名为 tuple 的 6 项。这对应于 URL 的一般结构:scheme://netloc/path;parameters?query#fragment。
解决方案
RFC 1808 的第 2.1 节显示了一个示例:
<scheme>://<net_loc>/<path>;<params>?<query>#<fragment>
each of which, except <scheme>, may be absent from a particular URL.
These components are defined as follows (a complete BNF is provided
in Section 2.2):
scheme ":" ::= scheme name, as per Section 2.1 of RFC 1738 [2].
"//" net_loc ::= network location and login information, as per
Section 3.1 of RFC 1738 [2].
"/" path ::= URL path, as per Section 3.1 of RFC 1738 [2].
";" params ::= object parameters (e.g., ";type=a" as in
Section 3.2.2 of RFC 1738 [2]).
"?" query ::= query information, as per Section 3.3 of
RFC 1738 [2].
"#" fragment ::= fragment identifier.
RFC 1738 的第 3.2.2 节处理 FTP URL;我不知道有任何其他使用参数的方案。(不过,直到 5 分钟前,我完全不知道参数部分。)
推荐阅读
- wpf - IsEnabled = false 使 WPF 按钮在使用 caliburn micro 时消失
- json - 使用 newman 批处理命令从 jenkins 运行的邮递员 json 集合。在詹金斯屏幕中填充二进制文件,请指导我解决此问题
- python - 如何使用特定日期时间查找文档?
- git - 将 VSTS 与 Github 集成
- r - 比较两个数据框的列联表
- android - GoogleMap moveCamera/animateCamera 不工作
- asp.net-core - 路由以允许来自查询字符串和默认 {id} 模板的参数
- javascript - 在 React 中获取输入的值并检查它
- umbraco - Umbraco:检查页面是否标记为受保护并重定向到登录
- azure - 服务总线的 Azure 函数绑定