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 2mo 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 27% 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://www.gravatar.com/avatar/d9137525d776143ddb2ade66e6be4f73d81d4ca89fd183cbda00eff8b404053f?d=identicon)[purplecode](/maintainers/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

[friendsofsymfony/rest-bundle

This Bundle provides various tools to rapidly develop RESTful API's with Symfony

2.8k73.3M319](/packages/friendsofsymfony-rest-bundle)[php-http/discovery

Finds and installs PSR-7, PSR-17, PSR-18 and HTTPlug implementations

1.3k309.5M1.2k](/packages/php-http-discovery)[nyholm/psr7

A fast PHP7 implementation of PSR-7

1.3k235.4M2.4k](/packages/nyholm-psr7)[pusher/pusher-php-server

Library for interacting with the Pusher REST API

1.5k94.8M293](/packages/pusher-pusher-php-server)[spatie/crawler

Crawl all internal links found on a website

2.8k16.3M52](/packages/spatie-crawler)[react/http

Event-driven, streaming HTTP client and server implementation for ReactPHP

78126.4M414](/packages/react-http)

PHPackages © 2026

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