class HttpClient (View source)

The http client that facilitates sending responses to the browser client.

Methods

__construct()

HttpClient constructor.

void
setServerApi(ServerApi $api)

Sets the api used to communicate to the client.

void
setResponseChunkSize(int $bytes)

Sets the size of the chunks in bytes that are sent to the browser.

void
omitBody(bool $omit = true)

Tells the client to omit the body from the response.

int
send(ResponseInterface $response)

Sends the given response to the browser.

Details

__construct()

HttpClient constructor.

void setServerApi(ServerApi $api)

Sets the api used to communicate to the client.

Parameters

ServerApi $api The api used to communicate to the client

Return Value

void

void setResponseChunkSize(int $bytes)

Sets the size of the chunks in bytes that are sent to the browser.

Parameters

int $bytes Size of chunks in bytes

Return Value

void

void omitBody(bool $omit = true)

Tells the client to omit the body from the response.

Parameters

bool $omit True to omit the body, false to include it

Return Value

void

int send(ResponseInterface $response)

Sends the given response to the browser.

Parameters

ResponseInterface $response The response to send

Return Value

int The number of bytes outputted