PHPackages                             josantonius/request - 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. josantonius/request

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

josantonius/request
===================

PHP library for handling requests.

2.0.1(3y ago)1157751MITPHPPHP ^7.4

Since Jan 17Pushed 3y ago3 watchersCompare

[ Source](https://github.com/josantonius/php-request)[ Packagist](https://packagist.org/packages/josantonius/request)[ GitHub Sponsors](https://github.com/Josantonius)[ RSS](/packages/josantonius-request/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (10)Dependencies (5)Versions (11)Used By (1)

PHP Request library
===================

[](#php-request-library)

[![Latest Stable Version](https://camo.githubusercontent.com/d61a0d042f16ba13ae038eca3d3e0110546907d825e3aeab5069300e40136679/68747470733a2f2f706f7365722e707567782e6f72672f6a6f73616e746f6e6975732f726571756573742f762f737461626c65)](https://packagist.org/packages/josantonius/request)[![License](https://camo.githubusercontent.com/bda495b4da4efd28da99816b7f322dcfefa8fb42a0bfaf9634d48e32da2843be/68747470733a2f2f706f7365722e707567782e6f72672f6a6f73616e746f6e6975732f726571756573742f6c6963656e7365)](LICENSE)

[Versión en español](README-ES.md)

PHP library for handling requests.

---

- [Requirements](#requirements)
- [Installation](#installation)
- [Available Methods](#available-methods)
- [Quick Start](#quick-start)
- [Usage](#usage)
- [Tests](#tests)
- [Sponsor](#Sponsor)
- [License](#license)

---

Requirements
------------

[](#requirements)

This library is supported by PHP 7.4.

**IMPORTANT**: Version 2.x does not support version [1.x](https://github.com/Josantonius/php-request/tree/1.1.7) of this library.

**IMPORTANT**: Version [1.x](https://github.com/Josantonius/php-request/tree/1.1.7) has been considered obsolete, but if you want to use it for 5.6 versions of PHP you can have a look at its [documentation](https://github.com/Josantonius/php-request/tree/1.1.7).

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

[](#installation)

The preferred way to install this extension is through [Composer](http://getcomposer.org/download/).

To install **PHP Request library**, simply:

```
composer require josantonius/request

```

The previous command will only install the necessary files, if you prefer to **download the entire source code** you can use:

```
composer require josantonius/request --prefer-source

```

You can also **clone the complete repository** with Git:

$ git clone

Or **install it manually**:

Download [Request.php](https://raw.githubusercontent.com/Josantonius/php-request/master/src/Request.php) and [Validate.php](https://raw.githubusercontent.com/Josantonius/php-validate/master/src/Validate.php):

```
wget https://raw.githubusercontent.com/Josantonius/php-request/master/src/Request.php

wget https://raw.githubusercontent.com/Josantonius/php-validate/master/src/Validate.php

```

Available Methods
-----------------

[](#available-methods)

Available methods in this library:

### - Check if it's a GET request

[](#--check-if-its-a-get-request)

```
Request::isGet();
```

**\# Return** (boolean)

### - Check if it's a POST request

[](#--check-if-its-a-post-request)

```
Request::isPost();
```

**\# Return** (boolean)

### - Check if it's a PUT request

[](#--check-if-its-a-put-request)

```
Request::isPut();
```

**\# Return** (boolean)

### - Check if it's a DELETE request

[](#--check-if-its-a-delete-request)

```
Request::isDelete();
```

**\# Return** (boolean)

### - Get request params

[](#--get-request-params)

For PUT and DELETE requests, the content type will be checked to correctly obtain the data received in the request.

The content types compatible with this library are:

- application/atom+xml
- text/html
- text/plain
- application/json
- application/javascript
- multipart/form-data
- application/x-www-form-urlencoded

```
Request::input($type);
```

AttributeDescriptionTypeRequiredDefault$typeRequest type.stringYes**\# Return** anonymous function that will return the Request object when it's called

### - Data sanitation and return as array

[](#--data-sanitation-and-return-as-array)

```
asArray($filters, $default);
```

AttributeDescriptionTypeRequiredDefault$filtersAssociative array with data type for each key. Fields that are not included in the filters will not be sanitized.arrayNo`[]`$defaultDefault value. Null or the default value will be returned for fields that do not match with the data type indicated.mixedNo`null`**\# Return** (array) → it will return an empty array in case of error

### - Data sanitation and return as object

[](#--data-sanitation-and-return-as-object)

```
asObject($filters, $default);
```

AttributeDescriptionTypeRequiredDefault$filtersAssociative array with data type for each key. Fields that are not included in the filters will not be sanitized.arrayNo`[]`$defaultDefault value. Null or the default value will be returned for fields that do not match with the data type indicated.mixedNo`null`**\# Return** (object) → it will return an empty object in case of error

### - Data sanitation and return as JSON

[](#--data-sanitation-and-return-as-json)

```
asJson($default);
```

AttributeDescriptionTypeRequiredDefault$defaultDefault value. Null or the default value will be returned for fields that do not match with the data type indicated.mixedNo`null`**\# Return** (mixed|null) → value, null or customized return value

### - Data sanitation and return as string

[](#--data-sanitation-and-return-as-string)

```
asString($default);
```

AttributeDescriptionTypeRequiredDefault$defaultDefault value. Null or the default value will be returned for fields that do not match with the data type indicated.mixedNo`null`**\# Return** (mixed|null) → value, null or customized return value

### - Data sanitation and return as integer

[](#--data-sanitation-and-return-as-integer)

```
asInteger($default);
```

AttributeDescriptionTypeRequiredDefault$defaultDefault value. Null or the default value will be returned for fields that do not match with the data type indicated.mixedNo`null`**\# Return** (mixed|null) → value, null or customized return value

### - Data sanitation and return as float

[](#--data-sanitation-and-return-as-float)

```
asFloat($default);
```

AttributeDescriptionTypeRequiredDefault$defaultDefault value. Null or the default value will be returned for fields that do not match with the data type indicated.mixedNo`null`**\# Return** (mixed|null) → value, null or customized return value

### - Data sanitation and return as boolean

[](#--data-sanitation-and-return-as-boolean)

```
asBoolean($default);
```

AttributeDescriptionTypeRequiredDefault$defaultDefault value. Null or the default value will be returned for fields that do not match with the data type indicated.mixedNo`null`**\# Return** (mixed|null) → value, null or customized return value

### - Data sanitation and return as IP address

[](#--data-sanitation-and-return-as-ip-address)

```
asIp($default);
```

AttributeDescriptionTypeRequiredDefault$defaultDefault value. Null or the default value will be returned for fields that do not match with the data type indicated.mixedNo`null`**\# Return** (mixed|null) → value, null or customized return value

### - Data sanitation and return as URL

[](#--data-sanitation-and-return-as-url)

```
asUrl($default);
```

AttributeDescriptionTypeRequiredDefault$defaultDefault value. Null or the default value will be returned for fields that do not match with the data type indicated.mixedNo`null`**\# Return** (mixed|null) → value, null or customized return value

### - Data sanitation and return as email

[](#--data-sanitation-and-return-as-email)

```
asEmail($default);
```

AttributeDescriptionTypeRequiredDefault$defaultDefault value. Null or the default value will be returned for fields that do not match with the data type indicated.mixedNo`null`**\# Return** (mixed|null) → value, null or customized return value

Quick Start
-----------

[](#quick-start)

To use this library with **Composer**:

```
require __DIR__ . '/vendor/autoload.php';

use Josantonius\Request\Request;
```

Or If you installed it **manually**, use it:

```
require_once __DIR__ . '/Request.php';
require_once __DIR__ . '/Validate.php';

use Josantonius\Request\Request;
use Josantonius\Validate\Validate;
```

Usage
-----

[](#usage)

For the examples it will be simulated that the following data is received in the request:

### Example data received in the request

[](#example-data-received-in-the-request)

```
'user_name' => 'John'
'user_surname' => 'Doe'
'user_age' => 35
'user_rating' => 8.5
'user_ip' => '89.58.54.188'
'user_website' => 'http://www.site.com/'
'user_email' => 'john@site.com'
'user_address' => [
  'street' => 'unknown'
  'locality' => 'Seville'
  'country' => 'Spain'
]
'is_active' => true
```

Example of use for this library:

### - Check if it's a GET request

[](#--check-if-its-a-get-request-1)

```
Request::isGet(); // true or false
```

### - Check if it's a POST request

[](#--check-if-its-a-post-request-1)

```
Request::isPost(); // true or false
```

### - Check if it's a PUT request

[](#--check-if-its-a-put-request-1)

```
Request::isPut(); // true or false
```

### - Check if it's a DELETE request

[](#--check-if-its-a-delete-request-1)

```
Request::isDelete(); // true or false
```

### - Access to the parameters of the request

[](#--access-to-the-parameters-of-the-request)

```
$_GET = Request::input('GET');

$_POST = Request::input('POST');

$_PUT = Request::input('PUT');

$_DELETE = Request::input('DELETE');
```

Returns an anonymous function that will return the Request object when it's called.

### - As array

[](#--as-array)

#### - Get and sanitize all data and return them as array

[](#--get-and-sanitize-all-data-and-return-them-as-array)

```
$array = $_GET()->asArray();

$array = $_POST()->asArray();

$array = $_PUT()->asArray();

$array = $_DELETE()->asArray();
```

```
var_dump($array);

/*
array(9) {
  ["user_name"]=>
  string(4) "John"
  ["user_surname"]=>
  string(3) "Doe"
  ["user_age"]=>
  int(35)
  ["user_rating"]=>
  float(8.5)
  ["user_ip"]=>
  string(12) "89.58.54.188"
  ["user_website"]=>
  string(20) "http://www.site.com/"
  ["user_email"]=>
  string(13) "john@site.com"
  ["user_address"]=>
  array(3) {
    ["street"]=>
    string(7) "unknown"
    ["locality"]=>
    string(7) "Seville"
    ["country"]=>
    string(5) "Spain"
  }
  ["is_active"]=>
  bool(true)
}
*/
```

- [Example data received in the request](#example-data-received-in-the-request)

#### - Obtain, sanitize all data and return them as array and filter each value according to the data type

[](#--obtain-sanitize-all-data-and-return-them-as-array-and-filter-each-value-according-to-the-data-type)

```
$filters = [
    'user_name' => 'string',
    'user_age' => 'string',
    'is_online' => 'boolean'
];

$array = $_GET()->asArray($filters);

$array = $_POST()->asArray($filters);

$array = $_PUT()->asArray($filters);

$array = $_DELETE()->asArray($filters);
```

```
var_dump($array['user_name']); // string(4) "John"

var_dump($array['user_age']); // string(2) "35" (although an integer is received, it's returned as a string)

var_dump($array['user_age']); // NULL (doesn't exist, the default value is returned)
```

- [Example data received in the request](#example-data-received-in-the-request)

#### - Obtain, sanitize all data and return them as array, filter each value according to the data type and specify a value for each key when it's wrong

[](#--obtain-sanitize-all-data-and-return-them-as-array-filter-each-value-according-to-the-data-type-and-specify-a-value-for-each-key-when-its-wrong)

```
$filters = [
    'user_rating' => 'float',
    'is_active' => 'boolean',
    'is_online' => 'boolean'
];

$array = $_GET()->asArray($filters, '');

$array = $_POST()->asArray($filters, '');

$array = $_PUT()->asArray($filters, '');

$array = $_DELETE()->asArray($filters, '');
```

```
var_dump($array['user_rating']); // float(8.5)

var_dump($array['is_active']); // bool(true)

var_dump($array['is_online']); // string(0) "" (doesn't exist, the default value is returned)
```

- [Example data received in the request](#example-data-received-in-the-request)

### - As object

[](#--as-object)

#### - Get and sanitize all data and return them as object

[](#--get-and-sanitize-all-data-and-return-them-as-object)

```
$object = $_GET()->asObject();

$object = $_POST()->asObject();

$object = $_PUT()->asObject();

$object = $_DELETE()->asObject();
```

```
var_dump($object);

/*
object(stdClass)#1 (9) {
  ["user_name"]=>
  string(4) "John"
  ["user_surname"]=>
  string(3) "Doe"
  ["user_age"]=>
  int(35)
  ["user_rating"]=>
  float(8.5)
  ["user_ip"]=>
  string(12) "89.58.54.188"
  ["user_website"]=>
  string(20) "http://www.site.com/"
  ["user_email"]=>
  string(13) "john@site.com"
  ["user_address"]=>
  object(stdClass)#2 (3) {
    ["street"]=>
    string(7) "unknown"
    ["locality"]=>
    string(7) "Seville"
    ["country"]=>
    string(5) "Spain"
  }
  ["is_active"]=>
  bool(true)
}
*/
```

- [Example data received in the request](#example-data-received-in-the-request)

#### - Obtain, sanitize all data and return them as object and filter each value according to the data type

[](#--obtain-sanitize-all-data-and-return-them-as-object-and-filter-each-value-according-to-the-data-type)

```
$filters = [
    'user_name' => 'string',
    'user_age' => 'integer',
    'is_online' => 'boolean'
];

$object = $_GET()->asObject($filters);

$object = $_POST()->asObject($filters);

$object = $_PUT()->asObject($filters);

$object = $_DELETE()->asObject($filters);
```

```
var_dump($object->user_name); // string(4) "John"

var_dump($object->user_age); // int(35)

var_dump($object->user_age); // NULL (doesn't exist, the default value is returned)
```

- [Example data received in the request](#example-data-received-in-the-request)

#### - Obtain, sanitize all data and return them as object, filter each value according to the data type and specify a value for each key when it's wrong

[](#--obtain-sanitize-all-data-and-return-them-as-object-filter-each-value-according-to-the-data-type-and-specify-a-value-for-each-key-when-its-wrong)

```
$filters = [
    'user_rating' => 'float',
    'user_surname' => 'boolean',
    'is_online' => 'boolean',
    'is_member' => 'boolean'
];

$object = $_GET()->asObject($filters, false);

$object = $_POST()->asObject($filters, false);

$object = $_PUT()->asObject($filters, false);

$object = $_DELETE()->asObject($filters, false);
```

```
var_dump($object->user_rating); // float(8.5)

var_dump($object->user_surname); // string(3) "Doe"

var_dump($object->is_online); // bool(false) (doesn't exist, the default value is returned)

var_dump($object->is_member); // bool(false) (doesn't exist, the default value is returned)
```

- [Example data received in the request](#example-data-received-in-the-request)

### - As JSON

[](#--as-json)

#### - Get and sanitize all data and return them as JSON

[](#--get-and-sanitize-all-data-and-return-them-as-json)

```
$json = $_GET()->asJson();

$json = $_POST()->asJson();

$json = $_PUT()->asJson();

$json = $_DELETE()->asJson();
```

```
var_dump($json);

/*
string(260) "{"user_name":"John","user_surname":"Doe","user_age":35,"user_rating":8.5,"user_ip":"89.58.54.188","user_website":"http:\/\/www.site.com\/","user_email":"john@site.com","user_address":{"street":"unknown","locality":"Seville","country":"Spain"},"is_active":true}"
*/
```

- [Example data received in the request](#example-data-received-in-the-request)

#### - Get specific key value, sanitize data and return them as JSON

[](#--get-specific-key-value-sanitize-data-and-return-them-as-json)

```
$json = $_GET('user_address')->asJson();

var_dump($json); // string(59) "{"street":"unknown","locality":"Seville","country":"Spain"}"
```

```
$json = $_POST('user_name')->asJson();

var_dump($json); // string(6) ""John""
```

```
$json = $_PUT('is_online')->asJson();

var_dump($json); // NULL (doesn't exist, the default value is returned)
```

```
$json = $_DELETE('user_address')->asJson([]);

var_dump($json); // string(2) "[]" (doesn't exist, the default value is returned)
```

- [Example data received in the request](#example-data-received-in-the-request)

### - As string

[](#--as-string)

#### - Get specific key value, sanitize data and return them as string

[](#--get-specific-key-value-sanitize-data-and-return-them-as-string)

```
$string = $_GET('user_age')->asString();

var_dump($string); // string(2) "35" (although an integer is received, it's returned as a string)
```

```
$string = $_POST('user_name')->asString();

var_dump($string); // string(4) "John"
```

```
$string = $_PUT('user_address')->asString();

var_dump($string); // NULL (it's an array, the default value is returned)
```

```
$string = $_DELETE('user_address')->asString('unknown');

var_dump($string); // string(7) "unknown" (it's an array, the default value is returned)
```

- [Example data received in the request](#example-data-received-in-the-request)

### - As integer

[](#--as-integer)

#### - Get specific key value, sanitize data and return them as integer

[](#--get-specific-key-value-sanitize-data-and-return-them-as-integer)

```
$integer = $_GET('user_age')->asInteger();

var_dump($integer); // int(35)
```

```
$integer = $_PUT('user_rating')->asInteger();

var_dump($integer); // NULL (it's a float, the default value is returned)
```

```
$integer = $_DELETE('user_rating')->asInteger(5);

var_dump($integer); // int(5) (it's a float, the default value is returned)
```

- [Example data received in the request](#example-data-received-in-the-request)

### - As float

[](#--as-float)

#### - Get specific key value, sanitize data and return them as float

[](#--get-specific-key-value-sanitize-data-and-return-them-as-float)

```
$float = $_GET('user_age')->asFloat();

var_dump($float); // float(35) (although an integer is received, it's returned as a float)
```

```
$float = $_POST('user_rating')->asFloat();

var_dump($float); // float(8.5)
```

```
$float = $_PUT('user_name')->asFloat();

var_dump($float); // NULL (it's a string, the default value is returned)
```

```
$float = $_DELETE('user_name')->asFloat(5.5);

var_dump($float); // float(5.5) (it's a string, the default value is returned)
```

- [Example data received in the request](#example-data-received-in-the-request)

### - As boolean

[](#--as-boolean)

#### - Get specific key value, sanitize data and return them as boolean

[](#--get-specific-key-value-sanitize-data-and-return-them-as-boolean)

```
$_GET['is_active'] = true;

$boolean = $_GET('is_active')->asBoolean();

var_dump($boolean); // bool(true)
```

```
$_GET['is_active'] = 'true';

$boolean = $_GET('is_active')->asBoolean();

var_dump($boolean); // bool(true)
```

```
$_POST['is_active'] = '1';

$boolean = $_POST('is_active')->asBoolean();

var_dump($boolean); // bool(true)
```

```
$_POST['is_active'] = 1;

$boolean = $_POST('is_active')->asBoolean();

var_dump($boolean); // bool(true)
```

```
$_GET['is_active'] = false;

$boolean = $_GET('is_active')->asBoolean();

var_dump($boolean); // bool(false)
```

```
$_GET['is_active'] = 'false';

$boolean = $_GET('is_active')->asBoolean();

var_dump($boolean); // bool(false)
```

```
$_POST['is_active'] = '0';

$boolean = $_POST('is_active')->asBoolean();

var_dump($boolean); // bool(false)
```

```
$_POST['is_active'] = 0;

$boolean = $_POST('is_active')->asBoolean();

var_dump($boolean); // bool(false)
```

```
$boolean = $_PUT('user_name')->asBoolean();

var_dump($boolean); // NULL (it's a string, the default value is returned)
```

```
$boolean = $_DELETE('is_online')->asBoolean(false);

var_dump($boolean); // bool(false) (doesn't exist, the default value is returned)
```

### - As IP

[](#--as-ip)

#### - Get specific key value, sanitize data and return them as IP

[](#--get-specific-key-value-sanitize-data-and-return-them-as-ip)

```
$ip = $_GET('user_ip')->asIp();

var_dump($ip); // string(12) "89.58.54.188"
```

```
$ip = $_POST('user_rating')->asIp();

var_dump($ip); // NULL (it's not an IP, the default value is returned)
```

```
$ip = $_DELETE('user_name')->asIp("87.32.48.164");

var_dump($ip); // string(12) "87.32.48.164" (it's not an IP, the default value is returned)
```

- [Example data received in the request](#example-data-received-in-the-request)

### - As URL

[](#--as-url)

filterRequest

#### - Get specific key value, sanitize data and return them as URL

[](#--get-specific-key-value-sanitize-data-and-return-them-as-url)

```
$url = $_GET('user_website')->asUrl();

var_dump($url); // string(20) "http://www.site.com/"
```

```
$url = $_POST('user_rating')->asUrl();

var_dump($url); // NULL (it's not an URL, the default value is returned)
```

```
$url = $_DELETE('user_name')->asUrl("http://www.site.com/");

var_dump($url); // string(20) "http://www.site.com/" (it's not an URL, the default value is returned)
```

- [Example data received in the request](#example-data-received-in-the-request)

### - As email

[](#--as-email)

#### - Get specific key value, sanitize data and return them as email

[](#--get-specific-key-value-sanitize-data-and-return-them-as-email)

```
$email = $_GET('user_website')->asEmail();

var_dump($email); // string(13) "john@site.com"
```

```
$email = $_POST('user_rating')->asEmail();

var_dump($email); // NULL (it's not an email, the default value is returned)
```

```
$email = $_DELETE('user_name')->asEmail("john@site.com");

var_dump($email); // string(13) "john@site.com" (it's not an email, the default value is returned)
```

- [Example data received in the request](#example-data-received-in-the-request)

Tests
-----

[](#tests)

To run [tests](tests) you just need [composer](http://getcomposer.org/download/) and to execute the following:

```
git clone https://github.com/Josantonius/php-request.git

cd php-request

composer install

```

Run unit tests with [PHPUnit](https://phpunit.de/):

```
gnome-terminal -e 'php -S localhost:8000 -t tests/'

composer phpunit

```

Run [PSR2](http://www.php-fig.org/psr/psr-2/) code standard tests with [PHPCS](https://github.com/squizlabs/PHP_CodeSniffer):

```
composer phpcs

```

Run [PHP Mess Detector](https://phpmd.org/) tests to detect inconsistencies in code style:

```
composer phpmd

```

Run all previous tests:

```
composer tests

```

Sponsor
-------

[](#sponsor)

If this project helps you to reduce your development time, [you can sponsor me](https://github.com/josantonius#sponsor) to support my open source work 😊

License
-------

[](#license)

This repository is licensed under the [MIT License](LICENSE).

Copyright © 2017-2022, [Josantonius](https://github.com/josantonius#contact)

###  Health Score

35

—

LowBetter than 79% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity69

Established project with proven stability

 Bus Factor1

Top contributor holds 95.3% 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 ~226 days

Recently: every ~435 days

Total

10

Last Release

1366d ago

Major Versions

1.1.7 → 2.0.02018-09-25

PHP version history (4 changes)1.0.0PHP &gt;=7.0

1.1.1PHP ^5.6 || ^7.0

2.0.0PHP ^7.0

2.0.1PHP ^7.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/4b221283501ec8a9cbaefaf27821a91ae8ddd33bddf1fccc6c6815b7ad216ff1?d=identicon)[Josantonius](/maintainers/Josantonius)

---

Top Contributors

[![josantonius](https://avatars.githubusercontent.com/u/18104336?v=4)](https://github.com/josantonius "josantonius (41 commits)")[![Mahdrentys](https://avatars.githubusercontent.com/u/40216477?v=4)](https://github.com/Mahdrentys "Mahdrentys (1 commits)")[![peter279k](https://avatars.githubusercontent.com/u/9021747?v=4)](https://github.com/peter279k "peter279k (1 commits)")

---

Tags

deletegethttp-requestsphpphp-requestpostputrequestphpajaxgetpostdeleteputhttp-methods

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/josantonius-request/health.svg)

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

###  Alternatives

[elementaryframework/water-pipe

URL routing framework and requests/responses handler for PHP

254.6k4](/packages/elementaryframework-water-pipe)[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)[phpgt/fetch

Asynchronous HTTP client with promises.

3724.0k3](/packages/phpgt-fetch)

PHPackages © 2026

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