首頁  >  文章  >  後端開發  >  PHP Curl HttpRPC

PHP Curl HttpRPC

WBOY
WBOY原創
2016-06-23 13:49:231556瀏覽

    /*       * @brief 执行URI     * @param $uri     * @return json     * @author fox     **/    private function _getHttpResponseGET($uri){        $curl = curl_init($uri);//initiate        curl_setopt($curl, CURLOPT_URL, $uri);        curl_setopt($curl,CURLOPT_HEADER,0);//filter http header        curl_setopt($curl,CURLOPT_RETURNTRANSFER,1);//show the output        curl_setopt($curl,CURLOPT_SSL_VERIFYPEER,true);//ssl certficate|authentication        curl_setopt($curl,CURLOPT_SSL_VERIFYHOST,2); //strict authentication        $content = curl_exec($curl);//execute and obtain the content        curl_close($curl);        return $content; }

陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn