Event EventHttpRequest::sendError

(PECL event >= 1.4.0-beta)

EventHttpRequest::sendError — 클라이언트에 HTML 오류 메시지 보내기


설명

public EventHttpRequest::sendError( int $error , string $reason = null): void

HTML 오류 메시지를 클라이언트에 보냅니다.


매개변수

error
HTTP 오류 코드입니다.
reason
오류에 대한 간략한 설명입니다. null인 경우 오류 코드의 표준 의미가 사용됩니다.

반환 값

값이 반환되지 않습니다.


Examples

예제 #1 EventHttpRequest::sendError() 예제

                  
<?php
function _http_400($req) {
    $req->sendError(400);
}

$base = new EventBase();
$http = new EventHttp($base);

$http->setCallback("/err400", "_http_400");

$http->bind("0.0.0.0", 8010);
$base->loop();
?>
                  
                

기타