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. [HTTP &amp; Networking](/categories/http)
4. /
5. securetrading/http

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

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(4mo ago)3535.7k↓43.5%3[1 PRs](https://github.com/Secure-Trading/PHP-Http/pulls)1MITPHPPHP ^8.2CI failing

Since Nov 16Pushed 4mo 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 2d 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

58

—

FairBetter than 98% of packages

Maintenance74

Regular maintenance activity

Popularity41

Moderate usage in the ecosystem

Community20

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

140d 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://avatars.githubusercontent.com/u/18596549?v=4)[Trust Payments](/maintainers/Secure-Trading)[@Secure-Trading](https://github.com/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

[symfony/http-kernel

Provides a structured process for converting a Request into a Response

8.1k869.4M8.8k](/packages/symfony-http-kernel)[symfony/http-client

Provides powerful methods to fetch HTTP resources synchronously or asynchronously

2.0k338.8M5.0k](/packages/symfony-http-client)[zircote/swagger-php

Generate interactive documentation for your RESTful API using PHP attributes (preferred) or PHPDoc annotations

5.3k144.5M604](/packages/zircote-swagger-php)[symfony/cache

Provides extended PSR-6, PSR-16 (and tags) implementations

4.2k373.5M3.3k](/packages/symfony-cache)[nelmio/api-doc-bundle

Generates documentation for your REST API from attributes

2.4k67.4M263](/packages/nelmio-api-doc-bundle)[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

21.7k38.9k](/packages/matomo-matomo)

PHPackages © 2026

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