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 details)

Uploaded Source

File details

Details for the file sanic_camelcase_middleware-1.1.2.tar.gz.

File metadata

  • Download URL: sanic_camelcase_middleware-1.1.2.tar.gz
  • Upload date:
  • Size: 2.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.5

File hashes

Hashes for sanic_camelcase_middleware-1.1.2.tar.gz
Algorithm Hash digest
SHA256 589e03c4ce296786981c15c30547610da93d2081c1165754979b40e85b7aa702
MD5 5b30d2908503eaee32248754dcae95fe
BLAKE2b-256 92378bfd545af9b6acd45252e2aaced69e27c843cddf8ed94c1a915d85756cce

See more details on using hashes here.

Supported by

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