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
from your_own_facility import YourOwnWSService | |
ws = YourOwnWSService('wss://example.com/WSAPI/') | |
message = { | |
"m": 0, | |
"i": 55, | |
"n": "YourName", | |
"o": "" |
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 | |
..... |
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
import urllib.parse | |
def urlencode(str): | |
return urllib.parse.quote(str) | |
def urldecode(str): | |
return urllib.parse.unquote(str) | |
str = '{"name": "Kinkin"}' |