furl简介
|
|
- scheme is the scheme string (all lowercase) or None. None means no scheme. An empty string means a protocol relative URL, like
//www.google.com
. - username is the username string for authentication.
- password is the password string for authentication with username.
- host is the domain name, IPv4, or IPv6 address as a string. Domain names are all lowercase.
- port is an integer or None. A value of None means no port specified and the default port for the given scheme should be inferred, if possible.
- path is a Path object comprised of path segments.
- query is a Query object comprised of query arguments.
- fragment is a Fragment object comprised of a Path and Query object separated by an optional
?
separator.
|
|
furl使用
端口
会根据协议自动识别默认端口,目前仅支持ftp,ssh,http,https
|
|
netloc
|
|
origin
|
|
Path
|
|
可以注意到链接末尾的/
被解析为''
,因为它被当作是一个目录:
|
|
对path进行规范化:
|
|
参数处理
|
|
有关query属性的例子:
|
|
''
与None
参数:
|
|
Fragment
|
|
fragment的分隔符是?
Encoding
|
|
Inline manipulation
|
|
copy
copy() creates and returns a new furl object with an identical URL.
|
|
join
|
|