PHP 클래스 Aerys\Body

Applications are invoked as soon as headers are received and before entity body data is parsed. The $request->body instance allows applications to await receipt of the full body (buffer) or stream it in chunks as it arrives. Buffering Example: $responder = function(Request $request, Response $response) { $bufferedBody = yield $request->getBody(); $response->send("Echoing back the request body: {$bufferedBody}"); }; Streaming Example: $responder = function(Request $request, Response $response) { $payload = ""; $body = $request->getBody() while (yield $body->valid()) { $payload .= $body->consume(); } $response->send("Echoing back the request body: {$payload}"); };
상속: extends Amp\PromiseStream, implements Amp\Promise
파일 보기 프로젝트 열기: amphp/aerys 1 사용 예제들

공개 메소드들

메소드 설명
__construct ( Amp\Promise $promise )
watch ( callable $func, $data = null )
when ( callable $func, $data = null )

메소드 상세

__construct() 공개 메소드

public __construct ( Amp\Promise $promise )
$promise Amp\Promise

watch() 공개 메소드

public watch ( callable $func, $data = null )
$func callable

when() 공개 메소드

public when ( callable $func, $data = null )
$func callable