Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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)
- Host: GitHub
- URL: https://github.com/uzulla/reactphp_postsupportsample
- Owner: uzulla
- Created: 2014-03-01T12:57:05.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2014-03-02T11:04:58.000Z (almost 11 years ago)
- Last Synced: 2023-03-23T12:14:15.011Z (almost 2 years ago)
- Language: PHP
- Size: 125 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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)