Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

falcon_params_verifier-0.1.0.tar.gz (2.3 kB view hashes)

Uploaded Source

Built Distribution

falcon_params_verifier-0.1.0-py3-none-any.whl (2.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page