ASIHTTPRequest post json to php server

后端 未结 2 936
执笔经年
执笔经年 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

    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.

提交回复
热议问题