def addPatient(request):
if request.method == 'POST':
# Convert JSON to python objects and
# store into the DB
recJSON = json.loads(request.body)
#logger.debug("%s",recJSON['SenderID'])
logger.debug("%s",request.body)
#print 'Raw Json "%s"' % request.body
return HttpResponse(json.dumps(request.body),content_type="application/json")
But getting an error at json.loads. ValueError: No JSON object could be decoded
Also I would appreciate if any one can direct me to good tutorial on Django (I already read http://www.djangobook.com/)
I dont know where and what I am doing wrong. I checked the client side message and it is JSON used http://jsonlint.com/ to validate it is JSON data.
Thank you once again.
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/5bc51870-6b56-456f-bc6d-18cf20487265%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CALn3ei1Sdb_QGG3hxixj2RNqiqaafjQMkwqGkpokXqcCOGgejA%40mail.gmail.com.