Middleware for camelizing request and response bodies for Sanic
Project description
sanic_camelcase_middlware
Middleware for camelizing request and response bodies for sanic
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.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2898b673e27bb769913cafc9bd428b900103ce14c00891b3303d5808b6168da4 |
|
MD5 | e6d06ef9989e35203d4fe7e0362706d0 |
|
BLAKE2b-256 | 420fbbedeeec43e5a20da1da0e5b32694efa309080da6a6b7dfd16ca7f557903 |