url.format(urlObj)
Take a parsed URL object, and return a formatted URL string.
Here's how the formatting process works:
-
hrefwill be ignored. -
pathwill be ignored. -
protocolis treated the same with or without the trailing:(colon).- The protocols
http,https,ftp,gopher,filewill be postfixed with://(colon-slash-slash) as long ashost/hostnameare present. - All other protocols
mailto,xmpp,aim,sftp,foo, etc will be postfixed with:(colon).
- The protocols
-
slashesset totrueif the protocol requires://(colon-slash-slash)- Only needs to be set for protocols not previously listed as requiring slashes, such as
mongodb://localhost:8000/, or ifhost/hostnameare absent.
- Only needs to be set for protocols not previously listed as requiring slashes, such as
-
authwill be used if present. -
hostnamewill only be used ifhostis absent. -
portwill only be used ifhostis absent. -
hostwill be used in place ofhostnameandport. -
pathnameis treated the same with or without the leading/(slash). -
query(object; seequerystring) will only be used ifsearchis absent. -
searchwill be used in place ofquery.- It is treated the same with or without the leading
?(question mark).
- It is treated the same with or without the leading
-
hashis treated the same with or without the leading#(pound sign, anchor).
Please login to continue.