Http Request

    function getSend($url,$param)
    {
        $ch = curl_init($url."?".$param);
        curl_setopt($ch,CURLOPT_RETURNTRANSFER, true);
        curl_setopt($ch, CURLOPT_BINARYTRANSFER, true) ;
        
        $output = curl_exec($ch);
        
        return $output;    
    }

    function postSend($url,$param){

        $ch = curl_init();
        curl_setopt($ch,CURLOPT_URL,$url);
        curl_setopt($ch,CURLOPT_POSTFIELDS,$param);
        curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);
        $data = curl_exec($ch);
        curl_close($ch);
        return $data;
    }

 

posted @ 2016-01-11 10:09  陈泽泽  阅读(146)  评论(0编辑  收藏  举报