yukiscoffee/coffeerequest

An asynchronous PHP network request library.

v3.3 2024-09-26 08:09 UTC

This package is auto-updated.

Last update: 2024-10-26 08:26:56 UTC


README

An asynchronous PHP network request library, including an API similar to JavaScript's fetch.

Installation

The recommended installation method is via Composer:

composer require yukiscoffee/coffeerequest

Usage

Network requests in CoffeeRequest use an asynchronous, Promise-based API just like fetch in JavaScript. Here is an example usage:

<?php

use YukisCoffee\CoffeeRequest\CoffeeRequest;

$requestPromise = CoffeeRequest::request("https://example.org");

$requestPromise->then(function($response) {
	echo $response->getText();
});

Acknowledgements

CoffeeRequest has been supported by the work of the following developers or projects:

  • Rehike - The primary project for which CoffeeRequest was made.
  • Isabella (kawapure) - A lead developer of Rehike who revised the CoffeeRequest source code during its use in Rehike.
  • Aubrey Pankow (aubymori) - A lead developer of Rehike who revised the CoffeeRequest source code during its use in Rehike.