athlon1600/php-curl-client

Simple PHP cURL Client

Maintainers

👁 Athlon1600

Package info

github.com/Athlon1600/php-curl-client

pkg:composer/athlon1600/php-curl-client

Statistics

Installs: 117 840

Dependents: 4

Suggesters: 0

Stars: 13

Open Issues: 0

v1.3.0 2026-01-14 17:39 UTC

Requires

Requires (Dev)

Suggests

None

Provides

None

Conflicts

None

Replaces

None

MIT 8782166b35c0c971db09d2c50907470d2828c372

curlhttp clientphp-curlphp curl client

This package is auto-updated.

Last update: 2026-06-14 18:40:37 UTC


README

👁 CI
👁 PHP Version
👁 GitHub License
👁 Image
👁 Packagist Downloads (custom server)

PHP Curl Client

Very simple curl client. Easy to use and extend to make it into your own custom HTTP client.

✔️ Supports PHP from version 7.3 to 8.4

Installation

composer require athlon1600/php-curl-client "^1.0"

Examples

use Curl\Client;

$client = new Client();

// returns standardized Response object no matter what
$response = $client->get('https://stackoverflow.com');

// 200
$status = $response->status;

// HTML content
$body = $response->body;

// curl_error() OR null
$error = $response->error;

// CurlInfo instance
$info = $response->info;

Update: $response->info now returns an object that will have an auto-complete on your IDE.

👁 Image
;

Works with POST requests too:

$client->post('http://httpbin.org/post', ['username' => 'bob', 'password' => 'test']);

or you can issue a completely customized request:

$client->request('GET', 'https://www.whatismyip.com/', null, [
 'User-Agent' => 'Mozilla/5.0 (iPhone; CPU iPhone OS 12_0 like Mac OS X)'
], [
 CURLOPT_PROXY => '127.0.0.1:8080',
 CURLOPT_TIMEOUT => 10
]);

TODO

  • make PSR-7 and PSR-18 compatible