Skip to main content

Middleware for camelizing request and response bodies for Sanic

Project description

CircleCI

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


Download files

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

Source Distribution

sanic_camelcase_middleware-1.1.2.tar.gz (2.1 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page