django ajax body to json
# In Django you need to deserialize the json
import json
def my_view(request):
body_unicode = request.body.decode('utf-8')
body = json.loads(body_unicode)
content = body['content']
django ajax body to json
# In Django you need to deserialize the json
import json
def my_view(request):
body_unicode = request.body.decode('utf-8')
body = json.loads(body_unicode)
content = body['content']
django ajax body to json
// From AJAX you need to post the data as JSON string rather than
// a JavaScript object.
payload = JSON.stringify({"name": "foo", "username":"bar"})
$.ajax({
url: 'some url',
type: "POST",
// ...
data: payload,
dataType: 'json',
//..
})
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us