nicolus/curl
最新稳定版本:1.0.4
Composer 安装命令:
composer require nicolus/curl
包简介
A simple curl OO wrapper
README 文档
README
A simple curl OO wrapper.
installation : add nicolus/curl to your composer.json
usage examples :
use Curl\Curl; try { $url = "http://www.google.com"; //A simple GET request (with followlocation and no timeout by default) echo Curl::get($url); //A simple POST request (multipart) : echo Curl::post($url, ["param1" => "value1" ]); //A simple POST request (x-www-urlencoded) : echo Curl::post($url, "param1=value1¶m2=value2"); //Using a proxy : echo (new Curl) ->setUrl($url) ->setProxy("myproxy.com:31280", "username", "password") ->request(); //A more complex request $curl = new Curl; echo $curl ->setUrl($url) ->addHeaders(['X-CUSTOMHEADER: aaa', 'pipoheader: bbb']) ->addHeaders('trololo: ccc') ->setAuth("Username", "Password") ->setTimeout(30) ->setUserAgent(Curl::UA_FIREFOX) ->request(); //Get info for the last request : print_r($curl->getInfo()); } catch (Exception $e) { echo "erreur avec une requête curl : " . $e->getMessage() ."<br>\n"; echo "code : " . $e->getCode() ."<br>\n"; }
统计信息
- 总下载量: 12
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2014-12-17