Lines Matching full:url
8 RFC 2732 : "Format for Literal IPv6 Addresses in URL's by R.Hinden, B.Carpenter
14 RFC 2368: "The mailto URL scheme", by P.Hoffman , L Masinter, J. Zawinski, July 1998.
19 RFC 1738: "Uniform Resource Locators (URL)" by T. Berners-Lee, L. Masinter, M.
245 _DefragResultBase = namedtuple('DefragResult', 'url fragment')
252 DefragResult(url, fragment)
254 A 2-tuple that contains the url without fragment identifier and the fragment
258 _DefragResultBase.url.__doc__ = """The URL with no fragment identifier."""
261 Fragment identifier separated from URL, that allows indirect identification of a
269 A 5-tuple that contains the different components of a URL. Similar to
273 _SplitResultBase.scheme.__doc__ = """Specifies URL scheme for the request."""
297 A 6-tuple that contains components of a parsed URL.
322 return self.url + '#' + self.fragment
324 return self.url
341 return self.url + b'#' + self.fragment
343 return self.url
369 def urlparse(url, scheme='', allow_fragments=True): argument
370 """Parse a URL into 6 components:
375 depending on the type of the url parameter.
381 component when no scheme is found in url.
389 url, scheme, _coerce_result = _coerce_args(url, scheme)
390 splitresult = urlsplit(url, scheme, allow_fragments)
391 scheme, netloc, url, query, fragment = splitresult
392 if scheme in uses_params and ';' in url:
393 url, params = _splitparams(url)
396 result = ParseResult(scheme, netloc, url, params, query, fragment)
399 def _splitparams(url): argument
400 if '/' in url:
401 i = url.find(';', url.rfind('/'))
403 return url, ''
405 i = url.find(';')
406 return url[:i], url[i+1:]
408 def _splitnetloc(url, start=0): argument
409 delim = len(url) # position of end of domain part of url, default is end
411 wdelim = url.find(c, start) # find first of this delim
414 return url[start:delim], url[delim:] # return (domain, rest)
434 def urlsplit(url, scheme='', allow_fragments=True): argument
435 """Parse a URL into 5 components:
440 depending on the type of the url parameter.
446 component when no scheme is found in url.
455 url, scheme, _coerce_result = _coerce_args(url, scheme)
457 key = url, scheme, allow_fragments, type(url), type(scheme)
464 i = url.find(':')
466 for c in url[:i]:
470 scheme, url = url[:i].lower(), url[i+1:]
472 if url[:2] == '//':
473 netloc, url = _splitnetloc(url, 2)
476 raise ValueError("Invalid IPv6 URL")
477 if allow_fragments and '#' in url:
478 url, fragment = url.split('#', 1)
479 if '?' in url:
480 url, query = url.split('?', 1)
482 v = SplitResult(scheme, netloc, url, query, fragment)
487 """Put a parsed URL back together again. This may result in a
488 slightly different, but equivalent URL, if the URL that was parsed
491 scheme, netloc, url, params, query, fragment, _coerce_result = (
494 url = "%s;%s" % (url, params)
495 return _coerce_result(urlunsplit((scheme, netloc, url, query, fragment)))
499 complete URL as a string. The data argument can be any five-item iterable.
500 This may result in a slightly different, but equivalent URL, if the URL that
503 scheme, netloc, url, query, fragment, _coerce_result = (
505 if netloc or (scheme and scheme in uses_netloc and url[:2] != '//'):
506 if url and url[:1] != '/': url = '/' + url
507 url = '//' + (netloc or '') + url
509 url = scheme + ':' + url
511 url = url + '?' + query
513 url = url + '#' + fragment
514 return _coerce_result(url)
516 def urljoin(base, url, allow_fragments=True): argument
517 """Join a base URL and a possibly relative URL to form an absolute
520 return url
521 if not url:
524 base, url, _coerce_result = _coerce_args(base, url)
528 urlparse(url, bscheme, allow_fragments)
531 return _coerce_result(url)
585 def urldefrag(url): argument
586 """Removes any existing fragment from URL.
588 Returns a tuple of the defragmented URL and the fragment. If
589 the URL contained no fragments, the second element is the
592 url, _coerce_result = _coerce_args(url)
593 if '#' in url:
594 s, n, p, a, q, frag = urlparse(url)
598 defrag = url
804 Each part of a URL, e.g. the path info, the query, etc., has a
818 Each of the reserved characters is reserved in some component of a URL,
829 Python 3.7 updates from using RFC 2396 to RFC 3986 to quote URL strings.
896 """Encode a dict or sequence of two-element tuples into a URL query string.
975 def to_bytes(url): argument
978 return _to_bytes(url)
981 def _to_bytes(url): argument
982 """to_bytes(u"URL") --> 'URL'."""
983 # Most URL schemes require ASCII. If that changes, the conversion
986 if isinstance(url, str):
988 url = url.encode("ASCII").decode()
990 raise UnicodeError("URL " + repr(url) +
992 return url
995 def unwrap(url): argument
996 """Transform a string like '<URL:scheme://host/path>' into 'scheme://host/path'.
998 The string is returned unchanged if it's not a wrapped URL.
1000 url = str(url).strip()
1001 if url[:1] == '<' and url[-1:] == '>':
1002 url = url[1:-1].strip()
1003 if url[:4] == 'URL:':
1004 url = url[4:].strip()
1005 return url
1008 def splittype(url): argument
1012 return _splittype(url)
1016 def _splittype(url): argument
1022 match = _typeprog.match(url)
1026 return None, url
1029 def splithost(url): argument
1033 return _splithost(url)
1037 def _splithost(url): argument
1043 match = _hostprog.match(url)
1049 return None, url
1125 def splitquery(url): argument
1129 return _splitquery(url)
1132 def _splitquery(url): argument
1134 path, delim, query = url.rpartition('?')
1137 return url, None
1140 def splittag(url): argument
1144 return _splittag(url)
1147 def _splittag(url): argument
1149 path, delim, tag = url.rpartition('#')
1152 return url, None
1155 def splitattr(url): argument
1159 return _splitattr(url)
1162 def _splitattr(url): argument
1165 words = url.split(';')