\GuzzleHttp\Psr7MessageTrait

Trait implementing functionality common to requests and responses.

Summary

Methods
Properties
Constants
getProtocolVersion()
withProtocolVersion()
getHeaders()
hasHeader()
getHeader()
getHeaderLine()
withHeader()
withAddedHeader()
withoutHeader()
getBody()
withBody()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
setHeaders()
normalizeHeaderValue()
trimHeaderValues()
assertHeader()
$headers
$headerNames
$protocol
$stream
N/A

Properties

$headers

$headers : array

Type

array — Map of all registered headers, as original name => array of values

$headerNames

$headerNames : array

Type

array — Map of lowercase header name => original name at registration

$protocol

$protocol : string

Type

string

Methods

getProtocolVersion()

getProtocolVersion() : mixed

Returns

mixed —

withProtocolVersion()

withProtocolVersion(mixed  $version) : mixed

Parameters

mixed $version

Returns

mixed —

getHeaders()

getHeaders() : mixed

Returns

mixed —

hasHeader()

hasHeader(mixed  $header) : mixed

Parameters

mixed $header

Returns

mixed —

getHeader()

getHeader(mixed  $header) : mixed

Parameters

mixed $header

Returns

mixed —

getHeaderLine()

getHeaderLine(mixed  $header) : mixed

Parameters

mixed $header

Returns

mixed —

withHeader()

withHeader(mixed  $header, mixed  $value) : mixed

Parameters

mixed $header
mixed $value

Returns

mixed —

withAddedHeader()

withAddedHeader(mixed  $header, mixed  $value) : mixed

Parameters

mixed $header
mixed $value

Returns

mixed —

withoutHeader()

withoutHeader(mixed  $header) : mixed

Parameters

mixed $header

Returns

mixed —

getBody()

getBody() : mixed

Returns

mixed —

withBody()

withBody(\Psr\Http\Message\StreamInterface  $body) : mixed

Parameters

\Psr\Http\Message\StreamInterface $body

Returns

mixed —

setHeaders()

setHeaders(array  $headers) : mixed

Parameters

array $headers

Returns

mixed —

normalizeHeaderValue()

normalizeHeaderValue(mixed  $value) : mixed

Parameters

mixed $value

Returns

mixed —

trimHeaderValues()

trimHeaderValues(string[]  $values) : string[]

Trims whitespace from the header values.

Spaces and tabs ought to be excluded by parsers when extracting the field value from a header field.

header-field = field-name ":" OWS field-value OWS OWS = *( SP / HTAB )

Parameters

string[] $values

Header values

Returns

string[] —

Trimmed header values

assertHeader()

assertHeader(mixed  $header) : mixed

Parameters

mixed $header

Returns

mixed —