A simple Falcon API "hook" to verify if a provided list of query parameters have been fulfilled.
Project description
Falcon Query Parameter Verifier
A simple falcon hook to check if a request contains all required query parameters.
Installation / Requirements
Installation:
PyPi
pip install falcon_params_verifier
.whl
A .whl
is provided in the releases tab in Github.
Sample Usage
Sample code
import falcon
import falcon_params_verifier
from falcon_params_verifier import ParamVerifier # This can also be used.
class SampleResource(object):
def __init__(self):
self._required_params = [
"userId",
]
# Add the hook
@falcon.before(falcon_params_verifier.ParamVerifier(self._required_params))
def on_get(self, req, resp):
req.media = {
"message": "Whoo hoo, you made a proper request!"
}
If a query parameter is missing, the module will automatically raise an falcon.HTTPBadRequest
.
Project details
Release history Release notifications | RSS feed
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
File details
Details for the file falcon_params_verifier-0.1.0.tar.gz
.
File metadata
- Download URL: falcon_params_verifier-0.1.0.tar.gz
- Upload date:
- Size: 2.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2846ad38bc07dc88def989ba67b31279b7470acc0b4ae513abf28f2413f4f1b2 |
|
MD5 | cf685132d6e1b074ad4f4ab3d06cceb3 |
|
BLAKE2b-256 | 01c2f272f073562cc5a7de3485b20f66b2b6472990699515fc014f06db5f9dd5 |
File details
Details for the file falcon_params_verifier-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: falcon_params_verifier-0.1.0-py3-none-any.whl
- Upload date:
- Size: 2.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 49278a57a0e63e098c9b32a0cfa0c32bd1bdf5c51561deb587ae1db79b70053e |
|
MD5 | 6bf4e462e8e7a1445656d452fc152e90 |
|
BLAKE2b-256 | 880faaea0ca0ac4d350a09e598a0fcf5a6644ca6b994d89691847007dbf2840c |