httpx_backend
Class info¶
🛈 DocStrings¶
The httpx layer: flavour selection (httpx2 or legacy httpx), cache, Pyodide transport.
get_httpx_module
¶
Return the httpx module to use.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str | None
|
Explicit module name ("httpx2" or "httpx"). If omitted, httpx2 is preferred and legacy httpx is used as a fallback. |
None
|
Raises:
| Type | Description |
|---|---|
ImportError
|
If no httpx flavour is installed. |
Source code in src/anyenv/download/httpx_backend/module.py
get_js_transport_class
cached
¶
Return a Pyodide fetch transport class for given httpx flavour.
Targets Pyodide 314.x (Python 3.14), where to_js already turns dicts into plain JS
objects (checked in a browser against 314.0.8); dict_converter=js.Object.fromEntries
is kept explicitly because fetch() ignores options passed as a JS Map.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
httpx_name
|
str | None
|
Module name of the httpx flavour ("httpx2" or "httpx"). Defaults to httpx2 if installed, else httpx. |
None
|