jleagle / curl-wrapper
An object oriented wrapper around cURL
Installs: 7 919
Dependents: 8
Suggesters: 0
Security: 0
Stars: 2
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- php: >=5.4
- ext-curl: *
- packaged/helpers: ~1.1
README
Using the helper
$response = Curl::get(URL)->run(); $response = Curl::get(URL, ['k' => 'v'])->run();
Manually making a cURL request
$response = Request::i() ->setUrl(URL) ->setPost() ->setBasicAuth('username', 'password') ->setPostFields(['k' => 'v']) ->run();
Reading the response
$response = Curl::get(URL)->run(); $connectTime = $response->getConnectTime(); $httpCode = $response->getHttpCode(); $error = $response->getErrorMessage();