Middleware for camelizing request and response bodies for Sanic
Project description
sanic_camelcase_middlware
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.1.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 51a83d92371db838a0cb2053372c64c6bc27e81cea891ad5d97cf452aaec9a82 |
|
MD5 | 5fe8d72e62095be52475be06311a1d28 |
|
BLAKE2b-256 | fcf37ab085ab4de113102e23c0a9851d079a4305f83312c77bc61b266b5a4466 |