lyoshenka / curl
A better way to cURL
v1.0.6
2017-03-05 18:41 UTC
Requires
- php: >=5.6
- ext-curl: *
This package is not auto-updated.
Last update: 2024-12-27 23:33:28 UTC
README
A simple wrapper around Curl to make it easy to use.
No more curl_init()
, no more struggling to get response headers, etc.
Two ways to use it
The functional way
echo \lyoshenka\curl::get('http://httpbin.org/user-agent', [], ['headers' => ['User-Agent' => 'nice!']]);
The fluent OO way
echo \lyoshenka\curl::init() ->setMethod('GET') ->setUrl('http://httpbin.org/user-agent') ->setHeader('User-Agent', 'also nice!') ->send() ->getBody();