Interface RequestContract
Representation of an outgoing, client-side request.
Per the HTTP specification, this interface includes properties for each of the following:
- Protocol version
- HTTP method
- URI
- Headers
- Message body
During construction, implementations MUST attempt to set the Host header from a provided URI if no Host header is provided.
Requests are considered immutable; all methods that might change state MUST be implemented such that they retain the internal state of the current message and return an instance that contains the changed state.
Contract interfaces enforce expected behavior in a non-colliding way. They are tasked with enforcing methods, and extending interfaces provided by standards and other packages for compatibility.
All valid oroboros classes MUST extend at
least one Contract Interface to be considered valid.
- oroboros\core\interfaces\contract\libraries\request\RequestContract implements oroboros\core\interfaces\contract\libraries\stream\MessageContract, Psr\Http\Message\RequestInterface
Direct known implementers
oroboros\core\abstracts\libraries\request\AbstractRequest
,
oroboros\core\interfaces\contract\libraries\request\ServerRequestContract
Indirect known implementers
oroboros\core\abstracts\libraries\request\AbstractServerRequest
,
oroboros\core\libraries\request\Request
,
oroboros\core\libraries\request\ServerRequest
Package: oroboros\core\message
Category: contract-interfaces
License: The MIT License (MIT)
Author: Brian Dayhoff mopsyd@me.com
Version: 0.2.4
Since: 0.2.4-alpha
Link: bitbucket.org/oroborosframework/oroboros-core/wiki/development/api/contract_interface.md
Located at core/interfaces/contract/libraries/request/RequestContract.php
Methods summary
public
|
#
__construct( scalar|resource|Psr\Http\Message\StreamInterface $body, array $headers = null, type $protocol = null, $host = null, $uri = null, $method = null )
|
public
string
|
|
public
static
|
|
public
string
|
|
public
static
|
|
public
UriInterface
|
|
public
static
|
Methods inherited from oroboros\core\interfaces\contract\libraries\stream\MessageContract
getBody()
,
getHeader()
,
getHeaderLine()
,
getHeaders()
,
getProtocolVersion()
,
hasHeader()
,
withAddedHeader()
,
withBody()
,
withHeader()
,
withProtocolVersion()
,
withoutHeader()
Methods inherited from oroboros\core\interfaces\contract\libraries\stream\StreamContract
__destruct()
,
__toString()
,
close()
,
detach()
,
eof()
,
getContents()
,
getMetadata()
,
getSize()
,
isReadable()
,
isSeekable()
,
isWritable()
,
read()
,
rewind()
,
seek()
,
tell()
,
write()