Join URL and path

Python

Use urllib to join a URL and path the proper way without worrying about leading or trailing slashes

py

import urllib.parse urllib.parse.urljoin("https://example.com/", "/path") # returns "https://example.com/path"