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

Function url_to_origin

tests/client/test_proxies.py:7–13  ·  view source on GitHub ↗

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 """
9 Given a URL string, return the origin in the raw tuple format that
10 `httpcore` uses for it's representation.
11 """
12 u = httpx.URL(url)
13 return httpcore.URL(scheme=u.raw_scheme, host=u.raw_host, port=u.port, target="/")
14
15
16def test_socks_proxy():

Callers 2

test_proxies_environFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected