Vedro + HTTPX
Project description
vedro-httpx
Installation
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
Usage
AsyncHTTPInterface
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)
SyncHTTPInterface
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)
Documentation
Check out the documentation for additional information about vedro-httpx
.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
vedro_httpx-0.5.0.tar.gz
(29.1 kB
view details)
Built Distribution
File details
Details for the file vedro_httpx-0.5.0.tar.gz
.
File metadata
- Download URL: vedro_httpx-0.5.0.tar.gz
- Upload date:
- Size: 29.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 017b18c195eb836bb6c0dce8ea281a7de1169a8d2346f8d1faa458d51a82a370 |
|
MD5 | 9cee236579888fc0c7f12af355454fc5 |
|
BLAKE2b-256 | 17de5ff35284768d09d56dcd8aa851b6ab1df321099798aeda343d67dad25fdc |
File details
Details for the file vedro_httpx-0.5.0-py3-none-any.whl
.
File metadata
- Download URL: vedro_httpx-0.5.0-py3-none-any.whl
- Upload date:
- Size: 33.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 01373edccb3c407e4e45a208a207cacc5fb1d4fb3b75f93d20709fb0b3e5255c |
|
MD5 | efa857e6bf77ab917a8727cc47798d83 |
|
BLAKE2b-256 | daa4085511279a7729465ed5f47a4588a2b2b5ffa11e9cc9305ef7ad62997dc3 |