Declare and validate HTTP query and path parameters in aiohttp
Project description
aiohttp-parameter-parser
Declare and validate HTTP query and path parameters in aiohttp
views.
Currently only path and URL query parameter location are supported.
Example usage:
from aiohttp import web
from aiohttp_parameter_parser import ParameterView
class ExampleHandler(ParameterView):
async def get(self) -> web.Response:
my_array_of_ints: int = self.query_parameter(
"parameter_name_in_request",
required=True,
is_array=True,
is_int=True,
)
# If provided parameter is of wrong type or missing,
# a default HTTP 400 response is returned to client.
return web.json_response({"received_param": my_array_of_ints})
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
Built Distribution
Close
Hashes for aiohttp-parameter-parser-0.1.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | a649d107eaf59aa9274ba13dbc05b9b872db8473653a749573da46095be84c8a |
|
MD5 | e1ec3cafb68029fa81befab44aaf1e8e |
|
BLAKE2b-256 | 96f35307a347575d22f2b86991f39b142c02575a2db16628df69e3ede431988f |
Close
Hashes for aiohttp_parameter_parser-0.1.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 20444ccfaf793aa8053fca7d5ef3cd6811ea52d1bfa57f01f909bf035ad0f9f6 |
|
MD5 | 0c65de0051e7c2bfedd5ab47b1409e5c |
|
BLAKE2b-256 | 26e50fb5a067dab2d17f371e92f7eb2d1333bc2efc3e56c6db4163f0753727c6 |