Created
February 15, 2017 08:55
-
-
Save nkentaro/85c10a79fa531544a7d734c8c63ff447 to your computer and use it in GitHub Desktop.
Retrieve Django's HttpRequest body as text string
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def some_view(request): | |
# HttpRequest.body is byte string | |
body = request.body.decode('utf-8') | |
# now body can be handled as a string | |
..... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment