PHPackages                             fyre/curl - 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. fyre/curl

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

fyre/curl
=========

A cURL library.

v3.0.1(6mo ago)0221MITPHP

Since Jun 17Pushed 6mo ago1 watchersCompare

[ Source](https://github.com/elusivecodes/FyreCURL)[ Packagist](https://packagist.org/packages/fyre/curl)[ RSS](/packages/fyre-curl/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (7)Versions (18)Used By (1)

FyreCURL
========

[](#fyrecurl)

**FyreCURL** is a free, open-source cURL request library for *PHP*.

Table Of Contents
-----------------

[](#table-of-contents)

- [Installation](#installation)
- [Methods](#methods)
- [Curl Requests](#curl-requests)
- [Curl Responses](#curl-responses)

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

[](#installation)

**Using Composer**

```
composer require fyre/curl

```

In PHP:

```
use Fyre\CURL\Curl;
```

Methods
-------

[](#methods)

**Delete**

Perform a DELETE request.

- `$url` is a string representing the URL.
- `$options` is an array containing the request options.
    - `headers` is an array containing additional headers to set, and will default to *\[\]*.
    - `userAgent` is a string representing the user agent, and will default to *null*.
    - `protocolVersion` is a string representing the HTTP protocol version, and will default to "*1.1*".
    - `username` is a string representing the HTTP authentication username, and will default to *null*.
    - `password` is a string representing the HTTP authentication password, and will default to *null*.
    - `auth` is a string representing the authentication method, and will default to "*basic*".
    - `sslCert` is a string representing the file path of the SSL certificate, and will default to *null*.
    - `sslPassword` is a string representing the SSL certificate password, and will default to *null*.
    - `sslKey` is a string representing the file path of the SSL key, and will default to *null*.
    - `cookie` is a string representing the file path of the cookie file, and will default to *null*.
    - `redirect` is a boolean indicating whether to allow redirects, and will default to *true*.
    - `redirectOptions` is an array containing redirect options.
        - `max` is a number representing the maximum number of redirects, and will default to *5*.
        - `strict` is a boolean indicating whether to only follow 301, 302 and 303 redirects, and will default to *true*.
        - `protocols` is an integer bitmask representing the protocols to allow redirects for, and will default to *CURLPROTO\_HTTP | CURLPROTO\_HTTPS*.
    - `verify` is a boolean indicating whether to verify the peer SSL certificate, and will default to *true*.
    - `delay` is a number representing the number of seconds to wait before executing the request, and will default to 0.
    - `timeout` is a number representing the maximum number of seconds for cURL to initialize, and will default to 0.
    - `connectTimeout` is a number representing the maximum number of seconds trying to connect, and will default to *150*.

```
$response = Curl::delete($url, $options);
```

This method returns a new [*CurlResponse*](#curl-responses).

**Get**

Perform a GET request.

- `$url` is a string representing the URL.
- `$options` is an array containing the request options.
    - `headers` is an array containing additional headers to set, and will default to *\[\]*.
    - `data` is an array containing additional data to send with the request, and will default to *null*.
    - `userAgent` is a string representing the user agent, and will default to *null*.
    - `protocolVersion` is a string representing the HTTP protocol version, and will default to "*1.1*".
    - `username` is a string representing the HTTP authentication username, and will default to *null*.
    - `password` is a string representing the HTTP authentication password, and will default to *null*.
    - `auth` is a string representing the authentication method, and will default to "*basic*".
    - `sslCert` is a string representing the file path of the SSL certificate, and will default to *null*.
    - `sslPassword` is a string representing the SSL certificate password, and will default to *null*.
    - `sslKey` is a string representing the file path of the SSL key, and will default to *null*.
    - `cookie` is a string representing the file path of the cookie file, and will default to *null*.
    - `redirect` is a boolean indicating whether to allow redirects, and will default to *true*.
    - `redirectOptions` is an array containing redirect options.
        - `max` is a number representing the maximum number of redirects, and will default to *5*.
        - `strict` is a boolean indicating whether to only follow 301, 302 and 303 redirects, and will default to *true*.
        - `protocols` is an integer bitmask representing the protocols to allow redirects for, and will default to *CURLPROTO\_HTTP | CURLPROTO\_HTTPS*.
    - `verify` is a boolean indicating whether to verify the peer SSL certificate, and will default to *true*.
    - `delay` is a number representing the number of seconds to wait before executing the request, and will default to 0.
    - `timeout` is a number representing the maximum number of seconds for cURL to initialize, and will default to 0.
    - `connectTimeout` is a number representing the maximum number of seconds trying to connect, and will default to *150*.

```
$response = Curl::get($url, $options);
```

This method returns a new [*CurlResponse*](#curl-responses).

**Head**

Perform a HEAD request.

- `$url` is a string representing the URL.
- `$options` is an array containing the request options.
    - `headers` is an array containing additional headers to set, and will default to *\[\]*.
    - `userAgent` is a string representing the user agent, and will default to *null*.
    - `protocolVersion` is a string representing the HTTP protocol version, and will default to "*1.1*".
    - `username` is a string representing the HTTP authentication username, and will default to *null*.
    - `password` is a string representing the HTTP authentication password, and will default to *null*.
    - `auth` is a string representing the authentication method, and will default to "*basic*".
    - `sslCert` is a string representing the file path of the SSL certificate, and will default to *null*.
    - `sslPassword` is a string representing the SSL certificate password, and will default to *null*.
    - `sslKey` is a string representing the file path of the SSL key, and will default to *null*.
    - `cookie` is a string representing the file path of the cookie file, and will default to *null*.
    - `redirect` is a boolean indicating whether to allow redirects, and will default to *true*.
    - `redirectOptions` is an array containing redirect options.
        - `max` is a number representing the maximum number of redirects, and will default to *5*.
        - `strict` is a boolean indicating whether to only follow 301, 302 and 303 redirects, and will default to *true*.
        - `protocols` is an integer bitmask representing the protocols to allow redirects for, and will default to *CURLPROTO\_HTTP | CURLPROTO\_HTTPS*.
    - `verify` is a boolean indicating whether to verify the peer SSL certificate, and will default to *true*.
    - `delay` is a number representing the number of seconds to wait before executing the request, and will default to 0.
    - `timeout` is a number representing the maximum number of seconds for cURL to initialize, and will default to 0.
    - `connectTimeout` is a number representing the maximum number of seconds trying to connect, and will default to *150*.

```
$response = Curl::head($url, $options);
```

This method returns a new [*CurlResponse*](#curl-responses).

**Options**

Perform an OPTIONS request.

- `$url` is a string representing the URL.
- `$options` is an array containing the request options.
    - `headers` is an array containing additional headers to set, and will default to *\[\]*.
    - `userAgent` is a string representing the user agent, and will default to *null*.
    - `protocolVersion` is a string representing the HTTP protocol version, and will default to "*1.1*".
    - `username` is a string representing the HTTP authentication username, and will default to *null*.
    - `password` is a string representing the HTTP authentication password, and will default to *null*.
    - `auth` is a string representing the authentication method, and will default to "*basic*".
    - `sslCert` is a string representing the file path of the SSL certificate, and will default to *null*.
    - `sslPassword` is a string representing the SSL certificate password, and will default to *null*.
    - `sslKey` is a string representing the file path of the SSL key, and will default to *null*.
    - `cookie` is a string representing the file path of the cookie file, and will default to *null*.
    - `redirect` is a boolean indicating whether to allow redirects, and will default to *true*.
    - `redirectOptions` is an array containing redirect options.
        - `max` is a number representing the maximum number of redirects, and will default to *5*.
        - `strict` is a boolean indicating whether to only follow 301, 302 and 303 redirects, and will default to *true*.
        - `protocols` is an integer bitmask representing the protocols to allow redirects for, and will default to *CURLPROTO\_HTTP | CURLPROTO\_HTTPS*.
    - `verify` is a boolean indicating whether to verify the peer SSL certificate, and will default to *true*.
    - `delay` is a number representing the number of seconds to wait before executing the request, and will default to 0.
    - `timeout` is a number representing the maximum number of seconds for cURL to initialize, and will default to 0.
    - `connectTimeout` is a number representing the maximum number of seconds trying to connect, and will default to *150*.

```
$response = Curl::options($url, $options);
```

This method returns a new [*CurlResponse*](#curl-responses).

**Patch**

Perform a PATCH request.

- `$url` is a string representing the URL.
- `$data` is an array containing the data.
- `$options` is an array containing the request options.
    - `headers` is an array containing additional headers to set, and will default to *\[\]*.
    - `dataType` is a string representing the type of data to send with the request, and will default to "*json*".
    - `userAgent` is a string representing the user agent, and will default to *null*.
    - `protocolVersion` is a string representing the HTTP protocol version, and will default to "*1.1*".
    - `username` is a string representing the HTTP authentication username, and will default to *null*.
    - `password` is a string representing the HTTP authentication password, and will default to *null*.
    - `auth` is a string representing the authentication method, and will default to "*basic*".
    - `sslCert` is a string representing the file path of the SSL certificate, and will default to *null*.
    - `sslPassword` is a string representing the SSL certificate password, and will default to *null*.
    - `sslKey` is a string representing the file path of the SSL key, and will default to *null*.
    - `cookie` is a string representing the file path of the cookie file, and will default to *null*.
    - `redirect` is a boolean indicating whether to allow redirects, and will default to *true*.
    - `redirectOptions` is an array containing redirect options.
        - `max` is a number representing the maximum number of redirects, and will default to *5*.
        - `strict` is a boolean indicating whether to only follow 301, 302 and 303 redirects, and will default to *true*.
        - `protocols` is an integer bitmask representing the protocols to allow redirects for, and will default to *CURLPROTO\_HTTP | CURLPROTO\_HTTPS*.
    - `verify` is a boolean indicating whether to verify the peer SSL certificate, and will default to *true*.
    - `delay` is a number representing the number of seconds to wait before executing the request, and will default to 0.
    - `timeout` is a number representing the maximum number of seconds for cURL to initialize, and will default to 0.
    - `connectTimeout` is a number representing the maximum number of seconds trying to connect, and will default to *150*.

```
$response = Curl::patch($url, $data, $options);
```

This method returns a new [*CurlResponse*](#curl-responses).

**Post**

Perform a POST request.

- `$url` is a string representing the URL.
- `$data` is an array containing the data.
- `$options` is an array containing the request options.
    - `headers` is an array containing additional headers to set, and will default to *\[\]*.
    - `dataType` is a string representing the type of data to send with the request, and will default to *null*.
    - `userAgent` is a string representing the user agent, and will default to *null*.
    - `protocolVersion` is a string representing the HTTP protocol version, and will default to "*1.1*".
    - `username` is a string representing the HTTP authentication username, and will default to *null*.
    - `password` is a string representing the HTTP authentication password, and will default to *null*.
    - `auth` is a string representing the authentication method, and will default to "*basic*".
    - `sslCert` is a string representing the file path of the SSL certificate, and will default to *null*.
    - `sslPassword` is a string representing the SSL certificate password, and will default to *null*.
    - `sslKey` is a string representing the file path of the SSL key, and will default to *null*.
    - `cookie` is a string representing the file path of the cookie file, and will default to *null*.
    - `redirect` is a boolean indicating whether to allow redirects, and will default to *true*.
    - `redirectOptions` is an array containing redirect options.
        - `max` is a number representing the maximum number of redirects, and will default to *5*.
        - `strict` is a boolean indicating whether to only follow 301, 302 and 303 redirects, and will default to *true*.
        - `protocols` is an integer bitmask representing the protocols to allow redirects for, and will default to *CURLPROTO\_HTTP | CURLPROTO\_HTTPS*.
    - `verify` is a boolean indicating whether to verify the peer SSL certificate, and will default to *true*.
    - `delay` is a number representing the number of seconds to wait before executing the request, and will default to 0.
    - `timeout` is a number representing the maximum number of seconds for cURL to initialize, and will default to 0.
    - `connectTimeout` is a number representing the maximum number of seconds trying to connect, and will default to *150*.

```
$response = Curl::post($url, $data, $options);
```

This method returns a new [*CurlResponse*](#curl-responses).

**Put**

Perform a PUT request.

- `$url` is a string representing the URL.
- `$data` is an array containing the data.
- `$options` is an array containing the request options.
    - `headers` is an array containing additional headers to set, and will default to *\[\]*.
    - `dataType` is a string representing the type of data to send with the request, and will default to "*json*".
    - `userAgent` is a string representing the user agent, and will default to *null*.
    - `protocolVersion` is a string representing the HTTP protocol version, and will default to "*1.1*".
    - `username` is a string representing the HTTP authentication username, and will default to *null*.
    - `password` is a string representing the HTTP authentication password, and will default to *null*.
    - `auth` is a string representing the authentication method, and will default to "*basic*".
    - `sslCert` is a string representing the file path of the SSL certificate, and will default to *null*.
    - `sslPassword` is a string representing the SSL certificate password, and will default to *null*.
    - `sslKey` is a string representing the file path of the SSL key, and will default to *null*.
    - `cookie` is a string representing the file path of the cookie file, and will default to *null*.
    - `redirect` is a boolean indicating whether to allow redirects, and will default to *true*.
    - `redirectOptions` is an array containing redirect options.
        - `max` is a number representing the maximum number of redirects, and will default to *5*.
        - `strict` is a boolean indicating whether to only follow 301, 302 and 303 redirects, and will default to *true*.
        - `protocols` is an integer bitmask representing the protocols to allow redirects for, and will default to *CURLPROTO\_HTTP | CURLPROTO\_HTTPS*.
    - `verify` is a boolean indicating whether to verify the peer SSL certificate, and will default to *true*.
    - `delay` is a number representing the number of seconds to wait before executing the request, and will default to 0.
    - `timeout` is a number representing the maximum number of seconds for cURL to initialize, and will default to 0.
    - `connectTimeout` is a number representing the maximum number of seconds trying to connect, and will default to *150*.

```
$response = Curl::put($url, $data, $options);
```

This method returns a new [*CurlResponse*](#curl-responses).

Curl Requests
-------------

[](#curl-requests)

This class extends the [*Request*](https://github.com/elusivecodes/FyreRequest) class.

```
use Fyre\CURL\CurlRequest;
```

- `$uri` is a [*Uri*](https://github.com/elusivecodes/FyreURI).
- `$options` is an array containing the request options.
    - `headers` is an array containing additional headers to set, and will default to *\[\]*.
    - `data` is an array containing additional data to send with the request, and will default to *null*.
    - `dataType` is a string representing the type of data to send with the request, and will default to "*json*".
    - `userAgent` is a string representing the user agent, and will default to *null*.
    - `protocolVersion` is a string representing the HTTP protocol version, and will default to "*1.1*".
    - `username` is a string representing the HTTP authentication username, and will default to *null*.
    - `password` is a string representing the HTTP authentication password, and will default to *null*.
    - `auth` is a string representing the authentication method, and will default to "*basic*".
    - `sslCert` is a string representing the file path of the SSL certificate, and will default to *null*.
    - `sslPassword` is a string representing the SSL certificate password, and will default to *null*.
    - `sslKey` is a string representing the file path of the SSL key, and will default to *null*.
    - `cookie` is a string representing the file path of the cookie file, and will default to *null*.
    - `redirect` is a boolean indicating whether to allow redirects, and will default to *true*.
    - `redirectOptions` is an array containing redirect options.
        - `max` is a number representing the maximum number of redirects, and will default to *5*.
        - `strict` is a boolean indicating whether to only follow 301, 302 and 303 redirects, and will default to *true*.
        - `protocols` is an integer bitmask representing the protocols to allow redirects for, and will default to *CURLPROTO\_HTTP | CURLPROTO\_HTTPS*.
    - `verify` is a boolean indicating whether to verify the peer SSL certificate, and will default to *true*.
    - `delay` is a number representing the number of seconds to wait before executing the request, and will default to 0.
    - `timeout` is a number representing the maximum number of seconds for cURL to initialize, and will default to 0.
    - `connectTimeout` is a number representing the maximum number of seconds trying to connect, and will default to *150*.

```
$request = new CurlRequest($url, $options);
```

**Send**

Send the request.

```
$response = $request->send();
```

This method returns a new [*CurlResponse*](#curl-responses).

Curl Responses
--------------

[](#curl-responses)

This class extends the [*Response*](https://github.com/elusivecodes/FyreResponse) class.

```
use Fyre\CURL\CurlResponse;
```

**Get Json**

Get the response body as decoded JSON.

- `$associative` is a boolean indicating whether to return JSON object as associative array, and will default to *true*.
- `$depth` is a number representing the maximum depth of nesting, and will default to *512*.
- `$flags` is a number representing additional flags to use for decoding, and will default to 0.

```
$data = $response->getJson($associative, $depth, $flags);
```

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance66

Regular maintenance activity

Popularity6

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 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 ~77 days

Recently: every ~30 days

Total

17

Last Release

197d ago

Major Versions

v1.0.1 → v2.02023-08-12

v2.0.13 → v3.02025-10-26

### Community

Maintainers

![](https://www.gravatar.com/avatar/fad81fd5941e3a637c8a5749d05ae3ed9314d5e2fee57f59c3d9ec3b41259c6b?d=identicon)[elusivecodes](/maintainers/elusivecodes)

---

Top Contributors

[![elusivecodes](https://avatars.githubusercontent.com/u/18050480?v=4)](https://github.com/elusivecodes "elusivecodes (15 commits)")

---

Tags

curlphp

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/fyre-curl/health.svg)

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

###  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)
