phpday 2027 - Call for Papers

The EventHttpRequest class

(PECL event >= 1.4.0-beta)

Introduction

Represents an HTTP request.

Class synopsis

class EventHttpRequest {
/* Constants */
const int CMD_GET = 1;
const int CMD_POST = 2;
const int CMD_HEAD = 4;
const int CMD_PUT = 8;
const int CMD_DELETE = 16;
const int CMD_OPTIONS = 32;
const int CMD_TRACE = 64;
const int CMD_CONNECT = 128;
const int CMD_PATCH = 256;
const int INPUT_HEADER = 1;
const int OUTPUT_HEADER = 2;
/* Methods */
public function addHeader( string $key , string $value , int $type ): bool
public function cancel(): void
public function clearHeaders(): void
public function closeConnection(): void
public function __construct( callable $callback , mixed $data = null )
public function findHeader( string $key , string $type ): void
public function free(): void
public function getBufferEvent(): EventBufferEvent
public function getCommand(): void
public function getHost(): string
public function getInputBuffer(): EventBuffer
public function getInputHeaders(): array
public function getOutputBuffer(): EventBuffer
public function getOutputHeaders(): void
public function getResponseCode(): int
public function getUri(): string
public function removeHeader( string $key , string $type ): void
public function sendError( int $error , string $reason = null ): void
public function sendReply( int $code , string $reason , EventBuffer $buf = ?): void
public function sendReplyChunk( EventBuffer $buf ): void
public function sendReplyEnd(): void
public function sendReplyStart( int $code , string $reason ): void
}

Predefined Constants

EventHttpRequest::CMD_GET

GET method(command)

EventHttpRequest::CMD_POST

POST method(command)

EventHttpRequest::CMD_HEAD

HEAD method(command)

EventHttpRequest::CMD_PUT

PUT method(command)

EventHttpRequest::CMD_DELETE

DELETE command(method)

EventHttpRequest::CMD_OPTIONS

OPTIONS method(command)

EventHttpRequest::CMD_TRACE

TRACE method(command)

EventHttpRequest::CMD_CONNECT

CONNECT method(command)

EventHttpRequest::CMD_PATCH

PATCH method(command)

EventHttpRequest::INPUT_HEADER

Request input header type.

EventHttpRequest::OUTPUT_HEADER

Request output header type.

Table of Contents

User Contributed Notes

There are no user contributed notes for this page.
Adding new notes is disabled. Please see the links in the Found A Problem? section.
To Top