PHPackages                             securetrading/http - 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. securetrading/http

ActiveLibrary

securetrading/http
==================

Secure Trading's HTTP package - provides a generic HTTP interface and an implementation that uses cURL. Supports logic for retries; SSL verification; etc.

4.0.1(3mo ago)2502.3k—7.3%3[1 PRs](https://github.com/Secure-Trading/PHP-Http/pulls)1MITPHPPHP ^8.2CI passing

Since Nov 16Pushed 3mo ago4 watchersCompare

[ Source](https://github.com/Secure-Trading/PHP-Http)[ Packagist](https://packagist.org/packages/securetrading/http)[ RSS](/packages/securetrading-http/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (4)Versions (9)Used By (1)

PHP-Http
========

[](#php-http)

A helper package used by other Secure Trading packages.

`Securetrading\Http\Curl` provides a wrapper around the core PHP cURL functions that contains connection retry and logging logic. A `\Securetrading\Http\CurlException` is thrown if the call it makes to `curl_exec()` fails.

Release History
---------------

[](#release-history)

VersionChanges4.0.1phpunit updates4.0.0PHP 8.1 and 8.2 compatibility.3.0.0PHP 7.3 and 7.4 compatibility.2.0.0PHP 7.3 and 7.4 compatibility.1.0.0Initial ReleasePHP Version Compatibility
-------------------------

[](#php-version-compatibility)

VersionChanges4.0.1PHP 8.24.0.0PHP 8.1 - PHP 8.23.0.0PHP 8.0.0 - PHP 8.0.32.0.0PHP 7.3 - PHP 7.41.0.0PHP 5.3 - PHP 7.2Using This Package
------------------

[](#using-this-package)

Run this in the root directory of your application:

```
composer require securetrading/http

```

\\Securetrading\\Http\\Curl - Usage
-----------------------------------

[](#securetradinghttpcurl---usage)

Instantiate the client like this:

```
$http = new \Securetrading\Http\Curl($logger, $configData)

# Where:
# $logger implements \Psr\Log\LoggerInterface
# $configData is a multidimensional array of config options.

```

Valid config options (and their default values) for the constructor are:

```
array(
    'url' => '',
    'user_agent' => '',
    'ssl_verify_peer' => true,
    'ssl_verify_host' => 2,
    'connect_timeout' => 5,
    'timeout' => 60,
    'http_headers' => array(),
    'ssl_cacertfile' => '',
    'proxy_host' => '',
    'proxy_port' => '',
    'username' => '',
'    password' => '',
    'curl_options' => array(),
    'sleep_seconds' => 1,
    'connect_attempts' => 20,
    'connect_attempts_timeout' => 40,
);

```

Call `send($requestMethod, $requestBody = '')` to make HTTP requests.

`get()` and `post($requestBody = '')` helper methods have also been provided for GET and POST HTTP requests.

###  Health Score

60

—

FairBetter than 99% of packages

Maintenance82

Actively maintained with recent releases

Popularity40

Moderate usage in the ecosystem

Community19

Small or concentrated contributor base

Maturity81

Battle-tested with a long release history

 Bus Factor2

2 contributors hold 50%+ of commits

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

Recently: every ~661 days

Total

7

Last Release

94d ago

Major Versions

1.0.2 → 2.0.02020-06-26

2.0.0 → 3.0.02021-04-20

3.0.0 → 4.0.02023-11-07

PHP version history (5 changes)1.0.0PHP &gt;=5.3.0

2.0.0PHP ^7.3

3.0.0PHP ^8.0

4.0.0PHP ^8.1

4.0.1PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/af146d416e32f8fc2fe031d981161aeabed078bcc265a89a7a40bc42c7a03194?d=identicon)[Secure-Trading](/maintainers/Secure-Trading)

---

Top Contributors

[![Secure-Trading](https://avatars.githubusercontent.com/u/18596549?v=4)](https://github.com/Secure-Trading "Secure-Trading (5 commits)")[![peter-barrow-ST](https://avatars.githubusercontent.com/u/2707530?v=4)](https://github.com/peter-barrow-ST "peter-barrow-ST (3 commits)")[![anthony-norman-tp](https://avatars.githubusercontent.com/u/107112886?v=4)](https://github.com/anthony-norman-tp "anthony-norman-tp (1 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")[![Pete171](https://avatars.githubusercontent.com/u/12558626?v=4)](https://github.com/Pete171 "Pete171 (1 commits)")

### Embed Badge

![Health badge](/badges/securetrading-http/health.svg)

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

###  Alternatives

[elgg/elgg

Elgg is an award-winning social networking engine, delivering the building blocks that enable businesses, schools, universities and associations to create their own fully-featured social networks and applications.

1.7k15.7k5](/packages/elgg-elgg)[api-platform/metadata

API Resource-oriented metadata attributes and factories

243.5M96](/packages/api-platform-metadata)[neos/flow

Flow Application Framework

862.0M451](/packages/neos-flow)[phpro/http-tools

HTTP tools for developing more consistent HTTP implementations.

28137.8k](/packages/phpro-http-tools)[flowwow/cloudpayments-php-client

cloudpayments api client

2188.2k](/packages/flowwow-cloudpayments-php-client)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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