PHPackages                             cythral/reqc - 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. [CLI &amp; Console](/categories/cli)
4. /
5. cythral/reqc

AbandonedArchivedLibrary[CLI &amp; Console](/categories/cli)

cythral/reqc
============

A library for handling incoming and outgoing requests.

v1.4.2(8y ago)01.0k1GPL-3.0PHPPHP &gt;=7.0

Since Nov 23Pushed 4y agoCompare

[ Source](https://github.com/cythral/reqc)[ Packagist](https://packagist.org/packages/cythral/reqc)[ RSS](/packages/cythral-reqc/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (7)Dependencies (2)Versions (9)Used By (1)

reqc [![Build Status](https://camo.githubusercontent.com/7adab07c78bd1f95521b90907ab47043134383912fe4fb7853d3b0e195278a51/68747470733a2f2f7472617669732d63692e6f72672f6379746872616c2f726571632e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/cythral/reqc) [![Coverage Status](https://camo.githubusercontent.com/e6d923190b55bf9f1d37698970c1c5aa231a065cf8229e6bca95996872aab0f2/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f6379746872616c2f726571632f62616467652e737667)](https://coveralls.io/github/cythral/reqc) [![License](https://camo.githubusercontent.com/8b59d97f09166dc0016167b7b0cf9a5830ee03c63f582ebd7ed5848ad497f1ef/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d47504c2d2d332e302d626c75652e737667)](https://github.com/cythral/reqc/blob/master/LICENSE) [![GitHub release](https://camo.githubusercontent.com/99bcb383c44dbbab82e2c6b7bbb3753be432ed892dfdfadf9b9651ae940a061b/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f6379746872616c2f726571632e737667)](https://github.com/cythral/reqc/releases/latest)
========================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================

[](#reqc----)

**Request handling made easy in PHP**

This project has been moved to Gitlab and is now called [Devisr HTTP](https://gitlab.com/devisr/http)
-----------------------------------------------------------------------------------------------------

[](#this-project-has-been-moved-to-gitlab-and-is-now-called-devisr-http)

---

**Request Controller (reqc)** is a php library for handling both incoming and outgoing HTTP, REST, JSON, EventStream/SSE, and CLI requests. An additional interface for WebSockets is to be added in a future release. This library aims to make handling requests and responses as easy as possible. If you would like a specific client, server or general feature added please feel free to request it in the [issues tab](https://github.com/cythral/reqc/issues) or open a pull request.

At this time, functionality in the HTTP Client is limited to simple requests that do require HTTP authentication or file uploading. Those features and more are to be added in future releases.

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

[](#installation)

To install reqc, use composer to install it to your project:

```
composer require cythral/reqc
```

Usage
-----

[](#usage)

### HTTP Client

[](#http-client)

reqc provides an HTTP client, acting as a wrapper for php's curl extension. In the future, it will also be able to use fsockopen as a fallback when curl is not available.

```
$request = new reqc\HTTP\Request($options);
var_dump($request->response);
```

where $options is an array that has the following key =&gt; value pairs:

- **url**\* - the url to make the request to
- **method** - the HTTP method to use (GET/POST/etc.)
- **headers** - an array of headers to set
- **json** - bool value, whether or not to parse the request and response bodies as json
- **data** - an array of key value pairs to send as post fields or json data. If content-type is set to application/json or if the json mode is used, this will automagically be json encoded.
- **handle-ratelimits** - defaults to true. If true, the request will attempt to retry until a non-429 response code is received.
- **max-attempts** - defaults to 5. Sets the maximum amount of retry attempts to make if handling rate limits.

\* indicates a required option

### EventStream Server

[](#eventstream-server)

Reqc provides a EventStream Server for sending Server-Sent Events. The interface is simple, the only method to note is send, which sends events to the client. This automatically sets the content-type and cache-control headers. To create and use an EventStream server, do:

```
$es = new reqc\EventStream\Server();

$es->send("testEventName", "hello world"); // named event
$es->send(1, "hello world"); // event with an id
$es->send(null, "hello world"); // event without a name or id
$es->send("test", [ "foo" => "bar" ]); // event with json data
```

### Request Constants

[](#request-constants)

Reqc exposes a number of different constants that help to determine how to handle an incoming request. Documentation for each of these is to be added.

Future
------

[](#future)

In the future, the ability to do multipart/formdata requests will be added as well as the ability to handle and make file uploads. Other features TBD.

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity63

Established project with proven stability

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

Total

7

Last Release

3054d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/27e3e3e187f5c8656e10223ec42bc8993c89468e27db4dd28690d8e23c791a89?d=identicon)[cythral](/maintainers/cythral)

---

Top Contributors

[![talenfisher](https://avatars.githubusercontent.com/u/28938011?v=4)](https://github.com/talenfisher "talenfisher (104 commits)")

---

Tags

clihttpjsonphpphrosesrequestssse

### Embed Badge

![Health badge](/badges/cythral-reqc/health.svg)

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

###  Alternatives

[wp-cli/wp-cli

WP-CLI framework

5.0k17.2M320](/packages/wp-cli-wp-cli)[consolidation/annotated-command

Initialize Symfony Console commands from annotated command class methods.

22569.8M19](/packages/consolidation-annotated-command)[chi-teck/drupal-code-generator

Drupal code generator

26947.8M5](/packages/chi-teck-drupal-code-generator)[seld/cli-prompt

Allows you to prompt for user input on the command line, and optionally hide the characters they type

24725.8M17](/packages/seld-cli-prompt)[illuminate/console

The Illuminate Console package.

12944.1M5.1k](/packages/illuminate-console)[php-tui/php-tui

Comprehensive TUI library heavily influenced by Ratatui

589747.0k6](/packages/php-tui-php-tui)

PHPackages © 2026

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