PHP Интерфейс Icicle\Http\Message\Message

Показать файл Открыть проект

Открытые методы

Метод Описание
getBody ( ) : Icicle\Stream\ReadableStream Returns the stream for the message body.
getHeader ( string $name ) : string Returns the value of the given header. If multiple headers were present for the named header, only the first header value will be returned. Use getHeaderAsArray() to return an array of all values for the particular header.
getHeaderAsArray ( string $name ) : array Returns the array of values for the given header or an empty array if the header does not exist.
getHeaders ( ) : array Returns the message headers as a string-indexed array of arrays of strings or an empty array if no headers have been set.
getProtocolVersion ( ) : string
hasHeader ( string $name ) : boolean Determines if the message has the given header.
withAddedHeader ( string $name, string | string[] $value ) : Icicle\Http\Message\Message Returns a new instance with the given value added to the named header. If the header did not exist, the header is created with the given value.
withBody ( Icicle\Stream\ReadableStream $stream ) : Icicle\Http\Message\Message Returns a new instance with the given stream for the message body.
withHeader ( string $name, string | string[] $value ) : Icicle\Http\Message\Message Returns a new instance with the given header. $value may be a string or an array of strings.
withProtocolVersion ( string $version ) : Icicle\Http\Message\Message Returns a new instance with the given protocol version.
withoutHeader ( string $name ) : Icicle\Http\Message\Message Returns a new instance without the given header.

Описание методов

getBody() публичный Метод

Returns the stream for the message body.
public getBody ( ) : Icicle\Stream\ReadableStream
Результат Icicle\Stream\ReadableStream

getHeader() публичный Метод

Returns an empty string if the header does not exist.
public getHeader ( string $name ) : string
$name string
Результат string

getHeaderAsArray() публичный Метод

Returns the array of values for the given header or an empty array if the header does not exist.
public getHeaderAsArray ( string $name ) : array
$name string
Результат array

getHeaders() публичный Метод

Returns the message headers as a string-indexed array of arrays of strings or an empty array if no headers have been set.
public getHeaders ( ) : array
Результат array

getProtocolVersion() публичный Метод

public getProtocolVersion ( ) : string
Результат string

hasHeader() публичный Метод

Determines if the message has the given header.
public hasHeader ( string $name ) : boolean
$name string
Результат boolean

withAddedHeader() публичный Метод

Returns a new instance with the given value added to the named header. If the header did not exist, the header is created with the given value.
public withAddedHeader ( string $name, string | string[] $value ) : Icicle\Http\Message\Message
$name string
$value string | string[]
Результат Icicle\Http\Message\Message

withBody() публичный Метод

Returns a new instance with the given stream for the message body.
public withBody ( Icicle\Stream\ReadableStream $stream ) : Icicle\Http\Message\Message
$stream Icicle\Stream\ReadableStream
Результат Icicle\Http\Message\Message

withHeader() публичный Метод

Returns a new instance with the given header. $value may be a string or an array of strings.
public withHeader ( string $name, string | string[] $value ) : Icicle\Http\Message\Message
$name string
$value string | string[]
Результат Icicle\Http\Message\Message

withProtocolVersion() публичный Метод

Returns a new instance with the given protocol version.
public withProtocolVersion ( string $version ) : Icicle\Http\Message\Message
$version string
Результат Icicle\Http\Message\Message

withoutHeader() публичный Метод

Returns a new instance without the given header.
public withoutHeader ( string $name ) : Icicle\Http\Message\Message
$name string
Результат Icicle\Http\Message\Message