falcon-params-verifier

A simple Falcon API "hook" to verify if a provided list of query parameters have been fulfilled.


License
MIT
Install
pip install falcon-params-verifier==0.1.0

Documentation

Falcon Query Parameter Verifier

Test Python Module PyPi Shield

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):
    # Add the hook
	@falcon.before(falcon_params_verifier.ParamVerifier(['userId'])
    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.