PHPackages                             rayblair/fetch-php - 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. rayblair/fetch-php

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

rayblair/fetch-php
==================

A functional way to do HTTP Requests in PHP

00PHP

Since Aug 27Pushed 1y ago1 watchersCompare

[ Source](https://github.com/rayblair06/fetch-php)[ Packagist](https://packagist.org/packages/rayblair/fetch-php)[ RSS](/packages/rayblair-fetch-php/feed)WikiDiscussions main Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

Fetch-PHP
=========

[](#fetch-php)

[![License](https://camo.githubusercontent.com/623f52ab9b58a6a0c90edaadd93a9200a40da141eb08e70d5e0df8aefe17905e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f726179626c61697230362f66657463682d706870)](https://camo.githubusercontent.com/623f52ab9b58a6a0c90edaadd93a9200a40da141eb08e70d5e0df8aefe17905e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f726179626c61697230362f66657463682d706870)[![Issues](https://camo.githubusercontent.com/152491ef0aef95e97d4b554044f7f1707c4d541d5132562e94548342197540e4/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f726179626c61697230362f66657463682d706870)](https://camo.githubusercontent.com/152491ef0aef95e97d4b554044f7f1707c4d541d5132562e94548342197540e4/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f726179626c61697230362f66657463682d706870)[![Forks](https://camo.githubusercontent.com/6b0020424392c2548e25536b30f0de4c0ca27376d11e417bde14c904877ba53e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f666f726b732f726179626c61697230362f66657463682d706870)](https://camo.githubusercontent.com/6b0020424392c2548e25536b30f0de4c0ca27376d11e417bde14c904877ba53e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f666f726b732f726179626c61697230362f66657463682d706870)[![Stars](https://camo.githubusercontent.com/feeddf91ce7c4022386a1abafc7bb116ab6fd6cdce420f28bd9dd401f61ae129/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f726179626c61697230362f66657463682d706870)](https://camo.githubusercontent.com/feeddf91ce7c4022386a1abafc7bb116ab6fd6cdce420f28bd9dd401f61ae129/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f726179626c61697230362f66657463682d706870)

Table of Contents
-----------------

[](#table-of-contents)

- [About the Project](#about-the-project)
- [Installation](#installation)
- [Usage](#usage)
- [Contributing](#contributing)
- [License](#license)
- [Contact](#contact)
- [Acknowledgements](#acknowledgements)

About the Project
-----------------

[](#about-the-project)

**A functional way to make HTTP Requests in PHP!**

This package is lightweight and has no dependencies, enabling developers to make HTTP requests in a clean and functional manner!

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

[](#installation)

### Prerequisites

[](#prerequisites)

- Composer

### Installation

[](#installation-1)

1. Install via Composer: ```
    composer require rayblair/fetch-php
    ```
2. **That's it!** You're ready to start making HTTP requests.

Usage
-----

[](#usage)

### GET Request

[](#get-request)

```
try {
    $response = fetch('https://jsonplaceholder.typicode.com/posts/1');

    echo $response;
} catch (Exception $e) {
    echo 'Error: ' . $e->getMessage();
}
```

### POST Request

[](#post-request)

```
try {
    $response = fetch('https://jsonplaceholder.typicode.com/posts', [
        'method' => 'POST',
        'headers' => [
            'Content-type: application/json; charset=UTF-8'
        ],
        'body' => [
            'title' => 'foo',
            'body' => 'bar',
            'userId' => 1
        ]
    ]);

    echo $response;
} catch (Exception $e) {
    echo 'Error: ' . $e->getMessage();
}
```

Contributing
------------

[](#contributing)

Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are **greatly appreciated**.

If you'd like to contribute, please follow these steps:

1. Fork the Project
2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)
3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)
4. Push to the Branch (`git push origin feature/AmazingFeature`)
5. Open a Pull Request

Alternatively, check out the issues tab for tasks that need to be done.

License
-------

[](#license)

Distributed under the GNU GPLv3 License. See `LICENSE` for more information.

Contact
-------

[](#contact)

Ray Blair -

Project Link:

Acknowledgements
----------------

[](#acknowledgements)

- [Awesome README Templates](https://github.com/matiassingers/awesome-readme)
- [Choose an Open Source License](https://choosealicense.com)
- [PHP](https://php.net/)

###  Health Score

13

—

LowBetter than 1% of packages

Maintenance27

Infrequent updates — may be unmaintained

Popularity0

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity18

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/ab35ad2244c1203e3b7f0fdbe2d765fcdcf92c4b51cddee2b82e522c841f4650?d=identicon)[rayblair06](/maintainers/rayblair06)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/rayblair-fetch-php/health.svg)

```
[![Health](https://phpackages.com/badges/rayblair-fetch-php/health.svg)](https://phpackages.com/packages/rayblair-fetch-php)
```

###  Alternatives

[php-http/cache-plugin

PSR-6 Cache plugin for HTTPlug

25126.1M82](/packages/php-http-cache-plugin)[illuminate/http

The Illuminate Http package.

11937.9M6.8k](/packages/illuminate-http)[rdkafka/rdkafka

A PHP extension for Kafka

2.2k24.3k1](/packages/rdkafka-rdkafka)[httpsoft/http-message

Strict and fast implementation of PSR-7 and PSR-17

87965.9k114](/packages/httpsoft-http-message)[mezzio/mezzio-router

Router subcomponent for Mezzio

265.4M90](/packages/mezzio-mezzio-router)[serpapi/google-search-results-php

Get Google, Bing, Baidu, Ebay, Yahoo, Yandex, Home depot, Naver, Apple, Duckduckgo, Youtube search results via SerpApi.com

69127.2k](/packages/serpapi-google-search-results-php)

PHPackages © 2026

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