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

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

struktal/struktal-curl
======================

A curl wrapper library for PHP

1.2.0(11mo ago)01.1k↓33.3%[1 issues](https://github.com/Struktal/struktal-curl/issues)3MITPHPPHP &gt;=8.0.0

Since Jun 7Pushed 11mo ago1 watchersCompare

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

READMEChangelog (2)DependenciesVersions (3)Used By (3)

Struktal-Curl for PHP
=====================

[](#struktal-curl-for-php)

This is a wrapper library for PHP's cURL functions. It allows you to easily send GET and POST requests

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

[](#installation)

To install this library, include it in your project using composer:

```
composer require struktal/struktal-curl
```

Usage
-----

[](#usage)

**Simple GET or POST requests**The following example shows how to send a GET request to a HTML page:

```
$curl = new Curl();
$curl->setUrl("URL");
$curl->setMethod(Curl::$METHOD_GET);
$curl->setHeaders([
    "Accept: text/html, application/xhtml+xml"
]);
$response = $curl->execute();
$responseCode = $curl->getHttpCode();
$curl->close();
```

`URL` is the URL of the server that you want to send the request to.

To send a POST request, simply replace `Curl::$METHOD_GET` with `Curl::$METHOD_POST`. However note, that the above example does not send any POST data to the server.

**POST requests with data**To send POST data to the server, use the `setPostFields()` method:

```
$curl = new Curl();
$curl->setUrl("URL");
$curl->setMethod(Curl::$METHOD_POST);
$curl->setHeaders([
    "Accept: application/json"
]);
$curl->setPostFields([
    "key" => "value"
]);
$response = $curl->execute();
$responseCode = $curl->getHttpCode();
$curl->close();
```

The above example requests a JSON response from the server with the URL `URL` and sends the POST data `key=value` along with the request.

You can also send JSON-encoded POST data by setting the `asJson` flag of the `setPostFields` method to `true`.

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance53

Moderate activity, may be stable

Popularity19

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity43

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

Total

2

Last Release

330d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/49905418?v=4)[Jens Ostertag](/maintainers/JensOstertag)[@JensOstertag](https://github.com/JensOstertag)

---

Top Contributors

[![JensOstertag](https://avatars.githubusercontent.com/u/49905418?v=4)](https://github.com/JensOstertag "JensOstertag (11 commits)")

---

Tags

curlwrapper

### Embed Badge

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

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

###  Alternatives

[rmccue/requests

A HTTP library written in PHP, for human beings.

3.6k34.5M258](/packages/rmccue-requests)[php-http/curl-client

PSR-18 and HTTPlug Async client with cURL

48247.0M384](/packages/php-http-curl-client)[smi2/phpclickhouse

PHP ClickHouse Client

83510.1M71](/packages/smi2-phpclickhouse)[stefangabos/zebra_curl

A high performance solution for making multiple HTTP requests concurrently, asynchronously from your PHP projects using cURL

21971.3k2](/packages/stefangabos-zebra-curl)[minicli/curly

Simple Curl Client

14262.4k5](/packages/minicli-curly)[bca/curl

cURL wrapper for PHP applications.

1144.0k](/packages/bca-curl)

PHPackages © 2026

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