ASIHTTPRequest post json to php server

帅比萌擦擦* 提交于 2019-11-28 07:47:33

Found the issue. I had a SSL redirect in the apache vhost config. Used a tcp packet sniffer to find it. once i remove the redirect i was able to receive the json data with:

$handle = fopen('php://input','r');
$jsonInput = fgets($handle);
$decoded = json_decode($jsonInput,true);
print_r($decoded);

Thanks to all those who helped.

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"];
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!