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 Api(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 Api(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.3.0.tar.gz
(11.1 kB
view hashes)
Built Distribution
Close
Hashes for vedro_httpx-0.3.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2067e0712b85cb16b90d9f87e3463972b5abbeeb553cf1474d6aa35805092649 |
|
MD5 | 3657d2ad8830920a8832431b8b1bf3b6 |
|
BLAKE2b-256 | 2aa32f302568ae22dfacd7737fbf13af65f533b3cde5bdd4a655423c02cb3566 |