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.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1eb14013c07ba21a216e40eb043a16519ca38e3d65b582e8c36054eb72662b10 |
|
MD5 | 421c41701782f96a6797cd6e73a7d5f5 |
|
BLAKE2b-256 | 680e43fb76458a72bfab7eabf749038670cafd4cdf2100bae882271b8c71c29f |
Close
Hashes for aiohttp_parameter_parser-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8ca3be6c9a2fa68d4c3ea2955d7c7e70bdfa82a820cb607687d1c2fbfde5f149 |
|
MD5 | b102ccb6506f20522a7f76d60291d88a |
|
BLAKE2b-256 | 7cfcbfb5b139ddd30a0591da8040713880db8c9143ce7029cd9f620accab3f9f |