Http\Server->on
最后更新于:2022-04-02 06:32:59
# Http\\Server->on
[TOC]
注册事件回调函数,与`Server->on`相同,不同之处是:
* `Http\Server->on`不接受`onConnect`/`onReceive`回调设置
* `Http\Server->on`额外接受1种新的事件类型`onRequest`
## onRequest事件
~~~
$http_server->on('request', function(swoole_http_request $request, swoole_http_response $response) {
$response->end("
';