PHPackages                             purplecode/pcurl - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. purplecode/pcurl

ActiveLibrary[HTTP &amp; Networking](/categories/http)

purplecode/pcurl
================

CURL wrapper for PHP &gt;= 5.3

3373PHP

Since Aug 3Pushed 10y ago2 watchersCompare

[ Source](https://github.com/purplecode/php.curl)[ Packagist](https://packagist.org/packages/purplecode/pcurl)[ RSS](/packages/purplecode-pcurl/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependenciesVersions (1)Used By (0)

php.curl
========

[](#phpcurl)

**PCurl** is a PHP client library for [RESTful](http://en.wikipedia.org/wiki/Representational_State_Transfer)web services.

PCurl supports GET/POST/PUT/DELETE request methods. Unlike other similar libaries supports also HTTPS certificates verification.

Composer Installation
---------------------

[](#composer-installation)

To install PCurl, use the following composer `require` statement:

```
{
    "require": {
        "purplecode/pcurl": "dev-master"
    }
}

```

or just copy-paste content of `src/` to your `libs`.

Usage
-----

[](#usage)

### PCurl.php

[](#pcurlphp)

Simple GET

```
$pcurl = new PCurl('http://www.google.pl');
$response = $pcurl->get('/')->getBody();

```

Simple GET via HTTPS with certificate verification (more examples in test package)

```
$pcurl = new PCurl('https://www.google.pl');
$pcurl->useSSLCertificate();
$response = $pcurl->get('/')->getBody();

```

and a similar example without it

```
$pcurl = new PCurl('https://www.google.pl');
$pcurl->ignoreSSLCertificate();
$response = $pcurl->get('/')->getBody();

```

Sample POST

```
$pcurl = new PCurl('http://some.fancy.page');
$pcurl->proxy(host, port);
$pcurl->auth(user, pass);
$pcurl->header('Cache-Control: no-cache');
$pcurl->contentType('application/xml');
$response = $pcurl->post('/igipigiel/xml', 'makapaka')->getBody();

```

### PJsonCurl.php

[](#pjsoncurlphp)

Class similar to PCurl, the only difference is that the input/output is passed through json\_encode/json\_decode.

```
$pcurl = new PJsonCurl('http://www.app.com/json');
$response = $pcurl->put('/', array('a' => 'b'));
echo $response->getBody()['c'];

```

### PObjectCurl.php

[](#pobjectcurlphp)

Class similar to PJsonCurl, the difference is that the input/output is passed through serialize/deserialize methods. Requires [JMS\\Serializer](https://github.com/schmittjoh/serializer) library or [JMSSerializerBundle](https://github.com/schmittjoh/JMSSerializerBundle) Symfony2 bundle.

```
$pcurl = new PObjectCurl('http://www.prettifier.com/json', JMS\Serializer\SerializerInterface $serializer);
$pcurl->responseClass('My\App\Preety');
$uglyObject =  new My\App\Ugly();
$preetyObject = $pcurl->put('/', $uglyObject)->getBody();

```

Enjoy!

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 97.2% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/3628756?v=4)[Mateusz Jaworski](/maintainers/purplecode)[@purplecode](https://github.com/purplecode)

---

Top Contributors

[![purplecode](https://avatars.githubusercontent.com/u/3628756?v=4)](https://github.com/purplecode "purplecode (35 commits)")[![skazi0](https://avatars.githubusercontent.com/u/2458112?v=4)](https://github.com/skazi0 "skazi0 (1 commits)")

### Embed Badge

![Health badge](/badges/purplecode-pcurl/health.svg)

```
[![Health](https://phpackages.com/badges/purplecode-pcurl/health.svg)](https://phpackages.com/packages/purplecode-pcurl)
```

###  Alternatives

[php-http/cache-plugin

PSR-6 Cache plugin for HTTPlug

25126.1M81](/packages/php-http-cache-plugin)[illuminate/http

The Illuminate Http package.

11937.9M6.8k](/packages/illuminate-http)[rdkafka/rdkafka

A PHP extension for Kafka

2.2k24.3k1](/packages/rdkafka-rdkafka)[httpsoft/http-message

Strict and fast implementation of PSR-7 and PSR-17

87965.9k114](/packages/httpsoft-http-message)[mezzio/mezzio-router

Router subcomponent for Mezzio

265.4M89](/packages/mezzio-mezzio-router)[serpapi/google-search-results-php

Get Google, Bing, Baidu, Ebay, Yahoo, Yandex, Home depot, Naver, Apple, Duckduckgo, Youtube search results via SerpApi.com

69127.2k](/packages/serpapi-google-search-results-php)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
