Skip to content

Simple async HTTP client library for fetching URLs, talking to RESTful APIs, downloading files, following redirects etc. built upon React PHP

License

Notifications You must be signed in to change notification settings

khanhtq/php-buzz-react

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

clue/buzz-react Build Status

Simple async HTTP client for concurrently interacting with multiple HTTP servers, fetching URLs, talking to RESTful APIs, downloading files, following redirects etc. all at the same time.

This library is heavily inspired by the great kriswallsmith/Buzz project. However, instead of blocking on each request, it relies on React PHP's EventLoop to process multiple requests in parallel.

This provides a higher level API that is easy to use in order to process (i.e. download or stream) multiple HTTP requests concurrently without having to mess with most of the low level details of the underlying react/http-client.

Note: This project is in early alpha stage! Feel free to report any issues you encounter.

Quickstart example

Once installed, you can use the following code to connect to your local http server and send some requests:

$client = new Browser($loop);

$client->get('http://www.google.com/')->then(function (BufferedResponse $result) {
    var_dump($result->getHeaders(), $result->getBody());
});

$loop->run();

Install

The recommended way to install this library is through composer. New to composer?

{
    "require": {
        "clue/buzz-react": "dev-master"
    }
}

License

MIT

About

Simple async HTTP client library for fetching URLs, talking to RESTful APIs, downloading files, following redirects etc. built upon React PHP

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%