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.4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4335ecb60cf08b7ddd05f8688175b7adf872ac11e6378efeb617271c32249324 |
|
MD5 | 5d6dbdff7f34a0b51038e7d68927ca40 |
|
BLAKE2b-256 | d12198b46357e245b8e062e2554b7c9f1de5e725aeeb4e5c6cbd7fd9ab745d8b |
Close
Hashes for aiohttp_parameter_parser-0.1.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8c1f8045dc0c18db9c8c85a8b292ae0269779ae6c1c28e02549978f766b8f3b6 |
|
MD5 | 89d4c9dcb6add2d8cfe55f42125e2dc1 |
|
BLAKE2b-256 | 13b127607a2b1479698b0553167e54451e07f36d23922f9d0948c23f7e53114b |