Dhruv Adhia
unread,Jul 3, 2009, 12:44:26 PM7/3/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Django users
Hello All,
I am trying to send information from iPhone to django app through
json.
I got "Message" json block spitting in the form as below:
message json format
{
"Messages": [
{
"id":1.2.3.....n,
"Message": "some message"
}
................
............
]
}
Now on the django side on apache server all I see is this,
{
"Messages": [ ]
}
In short I am not receiving the message, Here is the function that I
wrote in views.py
# I only want to receive the message therefore I am ignoring id
information
def message_json(request):
message_list=[]
try:
message_list = request.POST['Message']
except:
pass
data_out = simplejson.dumps({"Messages":
message_list},sort_keys=False, indent=4)
return HttpResponse('\n'.join([l.rstrip() for l in
data_out.splitlines()]),mimetype ="text/javascript")
Any thoughts?
Thank you,
Dhruv