array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'ja', ), 'this' => array ( 0 => 'eventhttprequest.senderror.php', 1 => 'EventHttpRequest::sendError', ), 'up' => array ( 0 => 'class.eventhttprequest.php', 1 => 'EventHttpRequest', ), 'prev' => array ( 0 => 'eventhttprequest.removeheader.php', 1 => 'EventHttpRequest::removeHeader', ), 'next' => array ( 0 => 'eventhttprequest.sendreply.php', 1 => 'EventHttpRequest::sendReply', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/event/eventhttprequest/senderror.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PECL event >= 1.4.0-beta)
EventHttpRequest::sendError — Send an HTML error message to the client
Send an HTML error message to the client.
error
The HTTP error code.
reason
A brief explanation ofthe error. If null
, the standard meaning of the
error code will be used.
値を返しません。
例1 EventHttpRequest::sendError() example
<?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();
?>