Middleware for camelizing request and response bodies for Sanic
Project description
Sanic Camelcase Middleware
Middleware for camelizing request and response bodies for sanic
Full documentation can be found here
How to install
pip install sanic-camelcase-middlware
Example
from sanic import Sanic
from sanic_camelcase_middleware import Camelize
app = Sanic(__name__)
Camelize(app)
Full example
from sanic import Sanic
from sanic.response import json
from sanic_camelcase_middleware import Camelize
app = Sanic(__name__)
Camelize(app)
@app.route("/post", methods=["POST"])
async def test(request):
return json("is_camelcase": True, "message": request.json})
if __name__ == "__main__":
app.run(host="0.0.0.0", port=8000)
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
Close
Hashes for sanic_camelcase_middleware-1.2.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2c830f052e385dbb787311b5fe80ead56ebfe09b2bd030f71bc2103dd6647525 |
|
MD5 | e3af33a4c3cc023341737a1a91231f11 |
|
BLAKE2b-256 | 767ac3c30c1ada870f58195f7b448cffb4c0104bdeeb6dc89b75665d73d4ed98 |