Skip to main content

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

This version

1.0.0

Download files

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

Files for sanic-camelcase-middleware, version 1.0.0
Filename, size File type Python version Upload date Hashes
Filename, size sanic_camelcase_middleware-1.0.0.tar.gz (1.5 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page