PHPackages                             icicleio/http - 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. icicleio/http

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

icicleio/http
=============

Asynchronous HTTP component for Icicle.

v0.3.0(10y ago)6143.3k↓16.7%4[7 issues](https://github.com/icicleio/http/issues)[1 PRs](https://github.com/icicleio/http/pulls)3MITPHP

Since Aug 25Pushed 9y ago12 watchersCompare

[ Source](https://github.com/icicleio/http)[ Packagist](https://packagist.org/packages/icicleio/http)[ Docs](http://icicle.io)[ RSS](/packages/icicleio-http/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)Dependencies (8)Versions (7)Used By (3)

HTTP for Icicle
===============

[](#http-for-icicle)

**Asynchronous, non-blocking HTTP/1.1 client and server.**

This library is a component for [Icicle](https://github.com/icicleio/icicle) that provides an HTTP/1.1 server and client implementations. Like other Icicle components, this library uses [Coroutines](https://icicle.io/docs/manual/coroutines/) built from [Awaitables](https://icicle.io/docs/manual/awaitables/) and [Generators](http://www.php.net/manual/en/language.generators.overview.php) to make writing asynchronous code more like writing synchronous code.

[![Build Status](https://camo.githubusercontent.com/e47ce3efb4723ba0170d2c7c595dae5fe30c8f7c67ff19fda206ae479c6c04a6/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f696369636c65696f2f687474702f76312e782e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/icicleio/http)[![Coverage Status](https://camo.githubusercontent.com/ef1ce7da59ee701deea23cf911d90ce5eb1b99e8d5359da64d32d8b61d765c3a/68747470733a2f2f696d672e736869656c64732e696f2f636f766572616c6c732f696369636c65696f2f687474702f76312e782e7376673f7374796c653d666c61742d737175617265)](https://coveralls.io/r/icicleio/http)[![Semantic Version](https://camo.githubusercontent.com/0f06f7d14df3cc8d0e86e538f60ec008f287d549fd34f591725058bdcf9f8045/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f696369636c65696f2f687474702e7376673f7374796c653d666c61742d737175617265)](http://semver.org)[![MIT License](https://camo.githubusercontent.com/27ecb1228ff4f9c191ccc6f416c1d3b24928f5d6bfd17738c108d03fc8ee04bf/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f696369636c65696f2f687474702e7376673f7374796c653d666c61742d737175617265)](LICENSE)[![@icicleio on Twitter](https://camo.githubusercontent.com/fb16a2e03bb85dd9926a15e837d3754b7766046281e2698271930aadbcd972cf/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f747769747465722d253430696369636c65696f2d3531383963372e7376673f7374796c653d666c61742d737175617265)](https://twitter.com/icicleio)

#### Documentation and Support

[](#documentation-and-support)

- [Full API Documentation](https://icicle.io/docs)
- [Official Twitter](https://twitter.com/icicleio)
- [Gitter Chat](https://gitter.im/icicleio/icicle)

##### Requirements

[](#requirements)

- PHP 5.5+ for v0.3.x branch (current stable) and v1.x branch (mirrors current stable)
- PHP 7 for v2.0 (master) branch supporting generator delegation and return expressions

##### Suggested

[](#suggested)

- [openssl extension](http://php.net/manual/en/book.openssl.php): Required to create HTTPS servers or make requests over HTTPS.

##### Installation

[](#installation)

The recommended way to install is with the [Composer](http://getcomposer.org/) package manager. (See the [Composer installation guide](https://getcomposer.org/doc/00-intro.md) for information on installing and using Composer.)

Run the following command to use this library in your project:

```
composer require icicleio/http
```

You can also manually edit `composer.json` to add this library as a project requirement.

```
// composer.json
{
    "require": {
        "icicleio/http": "^0.3"
    }
}
```

#### Example

[](#example)

The example below creates a simple HTTP server that responds with `Hello, world!` to every request.

```
#!/usr/bin/env php
