9951 explained code solutions for 126 technologies

php-swooleHTTP request get query string

$http = new Swoole\HTTP\Server('', 81);
$http->on('Request', function($req, $res) { echo $req->get['id'] . "\n"; });
$http->start();ctrl + c

creates HTTP server


do something when we got request from client


Swoole HTTP Request object to operate on request


output id param from query string of client request right into server output