join_url

docushare.join_url(*args)

Construct a full URL by combining a base URL with other URLs.

It is essentially a wrapper of urllib.parse.urljoin(). While urllib.parse.urljoin() accepts only two arguments, this wrapperfunction accepts multiple arguments to sequentially join the given items.

Examples

>>> join_url('https://www.example.com/', 'dir/', 'subdir/', 'filename.txt')
'https://www.example.com/dir/subdir/filename.txt'
>>> join_url('https://www.example.com/', 'dir/', 'subdir/', '/another_dir/' 'filename.bin')
'https://www.example.com/another_dir/filename.bin'