MCPcopy
hub / github.com/encode/httpx / url_to_origin

Function url_to_origin

tests/client/test_proxies.py:7–13  ·  tests/client/test_proxies.py::url_to_origin

Given a URL string, return the origin in the raw tuple format that `httpcore` uses for it's representation.

(url: str)

Source from the content-addressed store, hash-verified

5
6
7def url_to_origin(url: str) -> httpcore.URL:
8 class="st">"""
9 Given a URL string, return the origin in the raw tuple format that
10 `httpcore` uses for it&class="cm">#x27;s representation.
11 class="st">"""
12 u = httpx.URL(url)
13 return httpcore.URL(scheme=u.raw_scheme, host=u.raw_host, port=u.port, target=class="st">"/")
14
15
16def test_socks_proxy():

Callers 2

test_proxies_environFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected