make_url¶
- requests_pelican.utils.make_url(url, *paths, scheme=None, port=None, query=None, fragment=None)[source]¶
Construct a URL by combining a
hostand optionalpath.- url
str URL or part thereof.
- paths
str Zero or more path components to append to the full URL.
- scheme
str The scheme to use if not included in the
host. Ifhostspecifies port 80, this defaults to"http", otherwise"https".- port
int The port to use if not included in the
host. Default is to not include a port number.- query
str,dict A query string or
dictof params to include in the full URL.- fragment
str A URL fragment to include in the full URL.
Returns¶
- url
str A fully-qualified URL.
Examples¶
>>> make_url('osg-htc.org') 'https://osg-htc.org' >>> make_url('osg-htc.org:443', '/.well-known', 'pelican-configuration') 'https://osg-htc.org:443/.well-known/pelican-configuration
- url