Quick
For a quick installation, you can use a plugin manager as follows:
$ vedro plugin install vedro-httpx
Manual
To install manually, follow these steps:
- Install the package using pip:
$ pip3 install vedro-httpx
- Next, activate the plugin in your
vedro.cfg.py
configuration file:
# ./vedro.cfg.py
import vedro
import vedro_httpx
class Config(vedro.Config):
class Plugins(vedro.Config.Plugins):
class VedroHTTPX(vedro_httpx.VedroHTTPX):
enabled = True
from vedro_httpx import Response, AsyncHTTPInterface
class AuthAPI(AsyncHTTPInterface):
def __init__(self, base_url: str = "http://localhost:8080") -> None:
super().__init__(base_url)
async def register(self, creds: dict[str, str]) -> Response:
return await self._request("POST", "/auth/register", json=creds)
from vedro_httpx import Response, AsyncHTTPInterface
class AuthAPI(AsyncHTTPInterface):
def __init__(self, base_url: str = "http://localhost:8080") -> None:
super().__init__(base_url)
async def register(self, creds: dict[str, str]) -> Response:
return await self._request("POST", "/auth/register", json=creds)
Check out the documentation for additional information about vedro-httpx
.