Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/uzulla/reactphp_postsupportsample

reactPHP post params support sample. (only application/x-www-form-urlencoded)
https://github.com/uzulla/reactphp_postsupportsample

Last synced: about 1 month ago
JSON representation

reactPHP post params support sample. (only application/x-www-form-urlencoded)

Awesome Lists containing this project

README

        

ReactPHP Post parameter support sample
======================================

[ReactPHP](http://reactphp.org/)'s HTTP server lib is not support post method parameter.

\\Uzulla\\React\\* is post parameter support sample.

> code base ReactPHP 0.4.0

`Transfer-Encoding: chunked` not supported.

sample setup and run
==============

```
$ composer install
$ php ./boot.php
(or hhvm ./boot.php)
```

_require php>=5.4_

usage
=====

see `/boot.php`

## setup

```
// build reactor
$loop = React\EventLoop\Factory::create();
$socket = new React\Socket\Server($loop);
$http = new \Uzulla\React\Http\Server($socket);
$http->on('request', $app);
```

## get params.

```
$app = function (\Uzulla\React\Http\Request $req,\React\Http\Response $res) {
$query = $req->getQuery(); // get params (already existent)
$params = $req->getParams(); // post params (new add)
//...
}
```

comment
=======

ReactPHP is interesting.

see also
========

[ReactPHP (github)](https://github.com/reactphp/react)