PHP Interface Icicle\Http\Message\Message

Afficher le fichier Open project: icicleio/http

Méthodes publiques

Méthode Description
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.

Method Details

getBody() public méthode

Returns the stream for the message body.
public getBody ( ) : Icicle\Stream\ReadableStream
Résultat Icicle\Stream\ReadableStream

getHeader() public méthode

Returns an empty string if the header does not exist.
public getHeader ( string $name ) : string
$name string
Résultat string

getHeaderAsArray() public méthode

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
Résultat array

getHeaders() public méthode

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
Résultat array

getProtocolVersion() public méthode

public getProtocolVersion ( ) : string
Résultat string

hasHeader() public méthode

Determines if the message has the given header.
public hasHeader ( string $name ) : boolean
$name string
Résultat boolean

withAddedHeader() public méthode

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[]
Résultat Icicle\Http\Message\Message

withBody() public méthode

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
Résultat Icicle\Http\Message\Message

withHeader() public méthode

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[]
Résultat Icicle\Http\Message\Message

withProtocolVersion() public méthode

Returns a new instance with the given protocol version.
public withProtocolVersion ( string $version ) : Icicle\Http\Message\Message
$version string
Résultat Icicle\Http\Message\Message

withoutHeader() public méthode

Returns a new instance without the given header.
public withoutHeader ( string $name ) : Icicle\Http\Message\Message
$name string
Résultat Icicle\Http\Message\Message