PSR-7 request implementation.

CloneableInstantiable
ImplementsPsr\Http\Message\MessageInterface
Psr\Http\Message\RequestInterface
Methods
public __construct( $method, $uri, array $headers = [], $body = NULL, $version = '1.1')
 


    public getBody()
    public getHeader( $header)
    public getHeaderLine( $header)
    public getHeaders()
    public getMethod()
    public getProtocolVersion()
    public getRequestTarget()
    public getUri()
    public hasHeader( $header)
    public withAddedHeader( $header, $value)
    public withBody(Psr\Http\Message\StreamInterface $body)
    public withHeader( $header, $value)
    public withMethod( $method)
    public withoutHeader( $header)
    public withProtocolVersion( $version)
    public withRequestTarget( $requestTarget)
    public withUri(Psr\Http\Message\UriInterface $uri, $preserveHost = false)
    Properties
    private $headerNames
     


    • var array Map of lowercase header name => original name at registration
    private $headers
     


    • var array Map of all registered headers, as original name => array of values
    private $method
     


    • var string
    private $protocol
     


    • var string
    private $requestTarget
     


    • var null|string
    private $stream
     


    • var StreamInterface
    private $uri
     


    • var UriInterface
    Methods
    private assertHeader( $header)
    private assertMethod( $method)
    private normalizeHeaderValue( $value)
    private setHeaders(array $headers)
    private trimHeaderValues(array $values)
     
    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 )

    • return string[] Trimmed header values
    • see https://tools.ietf.org/html/rfc7230#section-3.2.4
    private updateHostFromUri()
    © 2020 Bruce Wells
    Search Namespaces \ Classes
    ConfigurationNumbers (0-9.) only