URL¶
CurlURL reads and edits a URL. It does not send a request.
from redc import CurlURL
u = CurlURL("https://user:pass@example.com:8080/path?q=1#frag")
u.query = None
u.port = 443
print(str(u))
# https://user:pass@example.com:443/path#frag
The parts are scheme, user, password, options, host, zoneid, port, path, query, and fragment. A missing part is None. port is an int.
CurlURL.is_valid_url only checks the string. It returns false when the URL is not valid.