cURL takes too long to load

前端 未结 2 721
臣服心动
臣服心动 2021-02-10 05:51

I am calling a REST endpoint in PHP using cURL to fetch some JSON data:



        
2条回答
  •  南方客
    南方客 (楼主)
    2021-02-10 06:05

    $ch = curl_init();
                        curl_setopt($ch, CURLOPT_URL, "set ur url");
                        curl_setopt($ch, CURLOPT_ENCODING , "gzip"); 
                        curl_setopt($ch, CURLOPT_ENCODING, '');    
    
                        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
                        $response  = curl_exec($ch);
                        curl_close($ch);
    

    Please check this example

提交回复
热议问题