Class rex_socket_response

Class for rex_socket responses.

Package: redaxo\core
Author: gharlan
Located at redaxo/src/core/lib/util/socket/socket_response.php

Methods summary

public
# __construct( resource $stream )

Constructor.

public integer
# getStatusCode( )

Returns the HTTP status code, e.g. 200.

public string
# getStatusMessage( )

Returns the HTTP status message, e.g. "OK".

public boolean
# isOk( )

Returns wether the status is "200 OK".

public boolean
# isInformational( )

Returns wether the status class is "Informational".

public boolean
# isSuccessful( )

Returns wether the status class is "Success".

public boolean
# isRedirection( )

Returns wether the status class is "Redirection".

public boolean
# isClientError( )

Returns wether the status class is "Client Error".

public boolean
# isServerError( )

Returns wether the status class is "Server Error".

public boolean
# isInvalid( )

Returns wether the status is invalid.

public string
# getHeader( string $key = null, string $default = null )

Returns the header for the given key, or the entire header if no key is given.

public boolean|string
# getBufferedBody( integer $length = 1024 )

Returns up to $length bytes from the body, or false if the end is reached.

public string
# getBody( )

Returns the entire body.

public boolean
# writeBodyTo( string|resource $resource )

Writes the body to the given resource.