Interface MessageContract
HTTP messages consist of requests from a client to a server and responses from a server to a client. This interface defines the methods common to each.
Messages 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\stream\MessageContract implements oroboros\core\interfaces\contract\libraries\stream\StreamContract, Psr\Http\Message\MessageInterface
Direct known implementers
oroboros\core\abstracts\libraries\stream\AbstractMessage
,
oroboros\core\interfaces\contract\libraries\request\RequestContract
,
oroboros\core\interfaces\contract\libraries\response\ResponseContract
Indirect known implementers
oroboros\core\abstracts\libraries\request\AbstractRequest
,
oroboros\core\abstracts\libraries\request\AbstractServerRequest
,
oroboros\core\abstracts\libraries\response\AbstractResponse
,
oroboros\core\interfaces\contract\libraries\request\ServerRequestContract
,
oroboros\core\interfaces\contract\libraries\response\ServerResponseContract
,
oroboros\core\libraries\request\Request
,
oroboros\core\libraries\request\ServerRequest
,
oroboros\core\libraries\response\Response
,
oroboros\core\libraries\stream\Message
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
Link: http://www.ietf.org/rfc/rfc7230.txt
Link: http://www.ietf.org/rfc/rfc7231.txt
Located at core/interfaces/contract/libraries/stream/MessageContract.php
Methods summary
public
|
#
__construct( scalar|resource|Psr\Http\Message\StreamInterface $body, array $headers = null, type $protocol = null )
|
public
string
|
|
public
static
|
#
withProtocolVersion( string $version )
Return an instance with the specified HTTP protocol version. |
public
string[][]
|
|
public
boolean
|
|
public
string[]
|
|
public
string
|
#
getHeaderLine( string $name )
Retrieves a comma-separated string of the values for a single header. |
public
static
|
#
withHeader( string $name, string|string[] $value )
Return an instance with the provided value replacing the specified header. |
public
static
|
#
withAddedHeader( string $name, string|string[] $value )
Return an instance with the specified header appended with the given value. |
public
static
|
|
public
StreamInterface
|
|
public
static
|
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()