ASIHTTPRequest post json to php server

后端 未结 2 958
执笔经年
执笔经年 2020-12-09 06:40

I have been trying to post a json object to a PHP script for the last 5 hours. I have read all the docs and it seems the code should work BUT it does not. The request is m

2条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-09 07:11

    I'm fairly sure that ASIHTTPRequest defaults to a GET request. YOu're trying to POST data so I don't think this will work.

    Try using ASIFormDataRequest which is built for POSTing data. Or, at the very least change the request method to POST.

     [request  setRequestMethod:@"POST"];
    

提交回复
热议问题