PHPackages                             tschallacka/http-to-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. tschallacka/http-to-curl

ActiveLibrary

tschallacka/http-to-curl
========================

A library that transforms PHPStorm's http request files to a PHP Curl resource

v1.0.0(3y ago)03MITPHPPHP &gt;=7.4

Since Sep 27Pushed 3y ago1 watchersCompare

[ Source](https://github.com/tschallacka/http-to-curl)[ Packagist](https://packagist.org/packages/tschallacka/http-to-curl)[ RSS](/packages/tschallacka-http-to-curl/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (2)Used By (0)

### HTTP TO CURL

[](#http-to-curl)

This library is there to help you to transform PHPSTORM's .http files to a php cURL request.

Installation
============

[](#installation)

```
  composer require tschallacka/http-to-curl
```

Usage
=====

[](#usage)

Tschallacka\\HttpToCurl\\Request\\CurlRequest
---------------------------------------------

[](#tschallackahttptocurlrequestcurlrequest)

CurlRequest is a helper class to give you what you need without concern of how

**doRequest**
This performs the request and returns the result.
First argument: The PHPSTORM .http file.
Second argument(optional): A callback to add your own curl options to the curl resource
returns: request content

```
use Tschallacka\HttpToCurl\Request\CurlRequest;

$result = CurlRequest::doRequest('path/to/request_file.http', function($ch) {
    curl_setopt($ch, CURLOPT_TIMEOUT, 42);
});
```

**getRequestData**
This reads the http file and returns the parsed request data
First argument: The PHPSTORM .http file
returns: Tschallacka\\HttpToCurl\\Request\\RequestData object

```
use Tschallacka\HttpToCurl\Request\CurlRequest;

$data = CurlRequest::getRequestData('path/to/request_file.http');
```

**getCurlBuilder**
This creates a curl resource builder from the given input file.
First argument: The PHPSTORM .http file
returns: Tschallacka\\HttpToCurl\\Request\\CurlBuilder object

```
use Tschallacka\HttpToCurl\Request\CurlRequest;

$data = CurlRequest::getCurlBuilder('path/to/request_file.http');
```

Tschallacka\\HttpToCurl\\Request\\CurlBuilder
---------------------------------------------

[](#tschallackahttptocurlrequestcurlbuilder)

**get**This creates a new cURL resource when it's called, based on the contents of the .http file it was generated from.

```
$response = null;
$builder = CurlRequest::getCurlBuilder($filepath);
$curl = $builder->get();
if ($curl) {
    $response = curl_exec($curl);
    curl_close($curl);
}
echo $response;
```

Attribution
-----------

[](#attribution)

Based and inspired on the original work by ahmadrosid at

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity46

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

Unknown

Total

1

Last Release

1322d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8b6652e857f4147b3528f5cab7ba1e923ca893221bc67ac1ebc5574555cae7fe?d=identicon)[Tschallacka](/maintainers/Tschallacka)

---

Top Contributors

[![tschallacka](https://avatars.githubusercontent.com/u/8638425?v=4)](https://github.com/tschallacka "tschallacka (2 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/tschallacka-http-to-curl/health.svg)

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

PHPackages © 2026

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