php8.5
Home/ Manual/ event / eventhttprequest/ EventHttpRequest::sendReplyStart

EventHttpRequest::sendReplyStart

PHP function Edit on GitHub ✎

(PECL event >= 1.4.0-beta)

Initiate a chunked reply

Description

EventHttpRequest::sendReplyStart(int $code, string $reason): void

Initiate a reply that uses Transfer-Encoding chunked.

This allows the caller to stream the reply back to the client and is useful when either not all of the reply data is immediately available or when sending very large replies.

The caller needs to supply data chunks with EventHttpRequest::sendReplyChunk and complete the reply by calling EventHttpRequest::sendReplyEnd.

Parameters

code

The HTTP response code to send.

reason

A brief message to send with the response code.

Return Values

Void

See Also

  • EventHttpRequest::sendReplyChunk
  • EventHttpRequest::sendReplyEnd

Source: reference/event/eventhttprequest/sendreplystart.xml · from the official PHP manual (php/doc-en)