make_url

requests_pelican.utils.make_url(url, *paths, scheme=None, port=None, query=None, fragment=None)[source]

Construct a URL by combining a host and optional path.

urlstr

URL or part thereof.

pathsstr

Zero or more path components to append to the full URL.

schemestr

The scheme to use if not included in the host. If host specifies port 80, this defaults to "http", otherwise "https".

portint

The port to use if not included in the host. Default is to not include a port number.

querystr, dict

A query string or dict of params to include in the full URL.

fragmentstr

A URL fragment to include in the full URL.

Returns

urlstr

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