iphone Json POST request to Django server creates QueryDict within QueryDict

后端 未结 3 2006
粉色の甜心
粉色の甜心 2020-12-15 13:48

I\'m creating a JSON POST request from Objective C using the JSON library like so:

NSMutableURLRequest *request;
request = [NSMutableURLRequest requestWithURL:[NS         


        
3条回答
  •  清酒与你
    2020-12-15 14:03

    I have already dealt with this issue. I found a temporary solution as reading the request.body dict. I assume you have imported the json/simplejson library already. In my view:

    post = request.body
    post = simplejson.loads(post)
    foo = post["foo"]
    

    This code block helped me to pass post issue. I think posting querydict in request.POST has not properly developed on NSMutableURLRequest yet.

提交回复
热议问题