PHPackages                             zero-to-prod/curl-helper - 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. zero-to-prod/curl-helper

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

zero-to-prod/curl-helper
========================

A helper for curl responses.

v1.1.0(1y ago)16.5k↓100%5MITDockerfilePHP &gt;=7.1CI passing

Since Feb 3Pushed 8mo ago1 watchersCompare

[ Source](https://github.com/zero-to-prod/curl-helper)[ Packagist](https://packagist.org/packages/zero-to-prod/curl-helper)[ Docs](https://github.com/zero-to-prod/curl-helper)[ Fund](https://github.com/sponsors/zero-to-prod)[ RSS](/packages/zero-to-prod-curl-helper/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (4)Dependencies (2)Versions (5)Used By (5)

Zerotoprod\\CurlHelper
======================

[](#zerotoprodcurlhelper)

[![](art/logo.png)](art/logo.png)

[![Repo](https://camo.githubusercontent.com/9a90a3efeee26aed7d7f2feee9cd84566a26f9c362cc773b184d076210906e1c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6769746875622d677261793f6c6f676f3d676974687562)](https://github.com/zero-to-prod/curl-helper)[![GitHub Actions Workflow Status](https://camo.githubusercontent.com/fa88f23230ec89fb22da2aa29783ea9e92a775c16d50071281290a3778685d41/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f7a65726f2d746f2d70726f642f6375726c2d68656c7065722f746573742e796d6c3f6c6162656c3d74657374)](https://github.com/zero-to-prod/curl-helper/actions)[![GitHub Actions Workflow Status](https://camo.githubusercontent.com/94e632983ff837bcbe37a2e3b1fea8fe1faf86c6fefea1d34b9ce094cdc6229f/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f7a65726f2d746f2d70726f642f6375726c2d68656c7065722f6261636b77617264735f636f6d7061746962696c6974792e796d6c3f6c6162656c3d6261636b77617264735f636f6d7061746962696c697479)](https://github.com/zero-to-prod/curl-helper/actions)[![Packagist Downloads](https://camo.githubusercontent.com/4b68154594e56f91ce1971ae05140e04ee17b2cdc546ef18777e092778599bb4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7a65726f2d746f2d70726f642f6375726c2d68656c7065723f636f6c6f723d626c7565)](https://packagist.org/packages/zero-to-prod/curl-helper/stats)[![php](https://camo.githubusercontent.com/4ee25f7779e10d37ad70a3e07c27441bdd8abb8841b7e3ee5ca1a0def2755e09/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f7a65726f2d746f2d70726f642f6375726c2d68656c7065722e7376673f636f6c6f723d707572706c65)](https://packagist.org/packages/zero-to-prod/curl-helper/stats)[![Packagist Version](https://camo.githubusercontent.com/a02898fdf063cb1348a3cc6c611ee08b9773f91e8bc6dd862da051d222ba76a3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7a65726f2d746f2d70726f642f6375726c2d68656c7065723f636f6c6f723d663238643161)](https://packagist.org/packages/zero-to-prod/curl-helper)[![License](https://camo.githubusercontent.com/9e189dc790c752b89538655beccf54a73bf20845a23806e0bb374f9024156c7f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f7a65726f2d746f2d70726f642f6375726c2d68656c7065723f636f6c6f723d70696e6b)](https://github.com/zero-to-prod/curl-helper/blob/main/LICENSE.md)[![wakatime](https://camo.githubusercontent.com/e5b5bbdb4f4cb47a10641ed2444d58b35380b009201c305b284bbbb7852864e7/68747470733a2f2f77616b6174696d652e636f6d2f62616467652f6769746875622f7a65726f2d746f2d70726f642f6375726c2d68656c7065722e737667)](https://wakatime.com/badge/github/zero-to-prod/curl-helper)[![Hits-of-Code](https://camo.githubusercontent.com/6110411da5708f8286583b004f0ac81cb2d1cbc622cb7b4b1991d0da09382078/68747470733a2f2f686974736f66636f64652e636f6d2f6769746875622f7a65726f2d746f2d70726f642f6375726c2d68656c7065723f6272616e63683d6d61696e)](https://hitsofcode.com/github/zero-to-prod/curl-helper/view?branch=main)

Contents
--------

[](#contents)

- [Introduction](#introduction)
- [Requirements](#requirements)
- [Installation](#installation)
- [Documentation Publishing](#documentation-publishing)
    - [Automatic Documentation Publishing](#automatic-documentation-publishing)
- [Usage](#usage)
    - [parseHeaders](#parseheaders)
- [Local Development](./LOCAL_DEVELOPMENT.md)
- [Contributing](#contributing)

Introduction
------------

[](#introduction)

A helper for curl.

Requirements
------------

[](#requirements)

- PHP 7.1 or higher.

Installation
------------

[](#installation)

Install `Zerotoprod\CurlHelper` via [Composer](https://getcomposer.org/):

```
composer require zero-to-prod/curl-helper
```

This will add the package to your project's dependencies and create an autoloader entry for it.

Documentation Publishing
------------------------

[](#documentation-publishing)

You can publish this README to your local documentation directory.

This can be useful for providing documentation for AI agents.

This can be done using the included script:

```
# Publish to default location (./docs/zero-to-prod/curl-helper)
vendor/bin/zero-to-prod-curl-helper

# Publish to custom directory
vendor/bin/zero-to-prod-curl-helper /path/to/your/docs
```

### Automatic Documentation Publishing

[](#automatic-documentation-publishing)

You can automatically publish documentation by adding the following to your `composer.json`:

```
{
    "scripts": {
        "post-install-cmd": [
            "zero-to-prod-curl-helper"
        ],
        "post-update-cmd": [
            "zero-to-prod-curl-helper"
        ]
    }
}
```

Usage
-----

[](#usage)

### parseHeaders()

[](#parseheaders)

Return the headers of a request as an array.

```
use Zerotoprod\CurlHelper\CurlHelper;

$CurlHandle = curl_init('https://google.com');
curl_setopt_array($CurlHandle, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HEADER => true,
]);
$response = curl_exec($CurlHandle);
$header_size = curl_getinfo($CurlHandle, CURLINFO_HEADER_SIZE);
curl_close($CurlHandle);

$headers = CurlHelper::parseHeaders($response, $header_size);
```

Contributing
------------

[](#contributing)

Contributions, issues, and feature requests are welcome! Feel free to check the [issues](https://github.com/zero-to-prod/curl-helper/issues) page if you want to contribute.

1. Fork the repository.
2. Create a new branch (`git checkout -b feature-branch`).
3. Commit changes (`git commit -m 'Add some feature'`).
4. Push to the branch (`git push origin feature-branch`).
5. Create a new Pull Request.

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance52

Moderate activity, may be stable

Popularity20

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity36

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% 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.

###  Release Activity

Cadence

Every ~0 days

Total

4

Last Release

461d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/502649f05d36c87d494988bd99193a4d908d345335d99c080928a726277371f5?d=identicon)[zero-to-prod](/maintainers/zero-to-prod)

---

Top Contributors

[![zero-to-prod](https://avatars.githubusercontent.com/u/61474950?v=4)](https://github.com/zero-to-prod "zero-to-prod (12 commits)")

---

Tags

zero-to-prodcurl-helper

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/zero-to-prod-curl-helper/health.svg)

```
[![Health](https://phpackages.com/badges/zero-to-prod-curl-helper/health.svg)](https://phpackages.com/packages/zero-to-prod-curl-helper)
```

###  Alternatives

[zero-to-prod/data-model

Transforms Data into Type-Safe DTOs.

14226.2k32](/packages/zero-to-prod-data-model)

PHPackages © 2026

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