A better way to cURL

v1.0.6 2017-03-05 18:41 UTC

This package is not auto-updated.

Last update: 2024-05-17 20:47:16 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();