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.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 700c73d7e2aaa0ffabc0ae9f45aeed986a080a018eac1753b0610484b1e2867f |
|
MD5 | 71c28c4294001f2380b8d8fb60d051e9 |
|
BLAKE2b-256 | 28cfd55a68ba703c8554e3534fdb009f6e09ad46809555f42b75c28ac1b01cb7 |
Close
Hashes for aiohttp_parameter_parser-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 07dfec7ad250c08ffbda070c353c7752051aba5234bff47474eae064b16a0f09 |
|
MD5 | 8bc9b56fdf1a989ddb4b234329da0d72 |
|
BLAKE2b-256 | 4d4f3d344014c0ec9366f47bd30ec9ffaf1a3968ab34460a189c816b18b02957 |