EventHttpRequest::sendError
(PECL event >= 1.4.0-beta)
EventHttpRequest::sendError — Send an HTML error message to the client
Description
public
void
EventHttpRequest::sendError
(
int
$error
[,
string
$reason
= NULL
] )Send an HTML error message to the client.
Parameters
-
error
-
The HTTP error code.
-
reason
-
A brief explanation ofthe error. If
NULL
, the standard meaning of the error code will be used.
Return Values
No value is returned.
Examples
Example #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();
?>
See Also
- EventHttpRequest::sendReply() - Send an HTML reply to the client
- Функция EventHttpRequest::addHeader() - Adds an HTTP header to the headers of the request
- Функция EventHttpRequest::cancel() - Cancels a pending HTTP request
- Функция EventHttpRequest::clearHeaders() - Removes all output headers from the header list of the request
- Функция EventHttpRequest::closeConnection() - Closes associated HTTP connection
- Функция EventHttpRequest::__construct() - Constructs EventHttpRequest object
- Функция EventHttpRequest::findHeader() - Finds the value belonging a header
- Функция EventHttpRequest::free() - Frees the object and removes associated events
- Функция EventHttpRequest::getBufferEvent() - Returns EventBufferEvent object
- Функция EventHttpRequest::getCommand() - Returns the request command(method)
- Функция EventHttpRequest::getConnection() - Returns EventHttpConnection object
- Функция EventHttpRequest::getHost() - Returns the request host
- Функция EventHttpRequest::getInputBuffer() - Returns the input buffer
- Функция EventHttpRequest::getInputHeaders() - Returns associative array of the input headers
- Функция EventHttpRequest::getOutputBuffer() - Returns the output buffer of the request
- Функция EventHttpRequest::getOutputHeaders() - Returns associative array of the input headers
- Функция EventHttpRequest::getResponseCode() - Returns the the response code
- Функция EventHttpRequest::getUri() - Returns the request URI
- Функция EventHttpRequest::removeHeader() - Removes an HTTP header from the headers of the request
- Функция EventHttpRequest::sendError() - Send an HTML error message to the client
- Функция EventHttpRequest::sendReply() - Send an HTML reply to the client
- Функция EventHttpRequest::sendReplyChunk() - Send another data chunk as part of an ongoing chunked reply
- Функция EventHttpRequest::sendReplyEnd() - Complete a chunked reply, freeing the request as appropriate
- Функция EventHttpRequest::sendReplyStart() - Initiate a chunked reply
Коментарии
404 Not Found