This is automatic generated document for things in Swow\Psr7\Message\AbstractMessage class

Class AbstractMessage

Properties

protected $body protected $headerNames

headers names holder format like [ 'x-header' => 'X-Header' ]

protected $headers

headers holder format like [ 'X-Header' => [ 'value 1', 'value 2' ] ]

protected $protocolVersion protected $shouldKeepAlive

Methods

Method addHeader

public function addHeader ( string $name , (string | array<string> | null) $value ) : static

Method getBody

public function getBody ( ) : StreamInterface

Method getContentLength

public function getContentLength ( ) : int

Method getContentType

public function getContentType ( ) : string

Method getHeader

public function getHeader ( mixed $name ) : array

Method getHeaderLine

public function getHeaderLine ( mixed $name ) : string

Method getHeaders

public function getHeaders ( ) : array<string, array<string>>

Returns array<string, array<string>> $headers

Method getProtocolVersion

public function getProtocolVersion ( ) : string

Method getStandardHeaders

public function getStandardHeaders ( ) : array<string, array<string>>

Returns array<string, array<string>> $headers

Method hasHeader

public function hasHeader ( mixed $name ) : bool

Method setBody

public function setBody ( mixed $body ) : static

Notice MUST clone the object before you change the body’s content

Method setHeader

public function setHeader ( string $name , (string | array<string> | null) $value ) : static

header will be unset when value is NULL, since headerValue must be an array, we can’t use NULL to mean that this header should not been sent.

Method setHeaders

public function setHeaders ( array<string, (array<string> | string)> $headers ) : static

Method setHeadersAndHeaderNames

public function setHeadersAndHeaderNames ( array<string, (array<string> | string)> $headers , array<string, string> $headerNames ) : static

Method setProtocolVersion

public function setProtocolVersion ( string $protocolVersion ) : static

Method setShouldKeepAlive

public function setShouldKeepAlive ( bool $shouldKeepAlive ) : static

Method shouldKeepAlive

public function shouldKeepAlive ( ) : bool

Method toString

public function toString ( bool $withoutBody ) : string

Method unsetHeader

public function unsetHeader ( string $name ) : static

Method withAddedHeader

public function withAddedHeader ( string $name , (string | string[]) $value ) : static

Method withBody

public function withBody ( StreamInterface $body ) : static

Method withHeader

public function withHeader ( string $name , (string | string[]) $value ) : static

Method withHeaders

public function withHeaders ( array<string, (array<string> | string)> $headers ) : static

Method withProtocolVersion

public function withProtocolVersion ( mixed $version ) : static

Method withoutHeader

public function withoutHeader ( string $name ) : static

Copyright 2022 the Swow contributors