Interfaces Summary |
ServerRequestInterface
|
Representation of an incoming, server-side HTTP request.
Per the HTTP specification, this interface includes properties for
each of the following:
- Protocol version
- HTTP method
- URI
- Headers
- Message body
Additionally, it encapsulates all data as it has arrived to the
application from the CGI and/or PHP environment, including:
- The values represented in $_SERVER.
- Any cookies provided (generally via $_COOKIE)
- Query string arguments (generally via $_GET, or as parsed via parse_str())
- Upload files, if any (as represented by $_FILES)
- Deserialized body parameters (generally from $_POST)
$_SERVER values MUST be treated as immutable, as they represent application
state at the time of request; as such, no methods are provided to allow
modification of those values. The other values provide such methods, as they
can be restored from $_SERVER or the request body, and may need treatment
during the application (e.g., body parameters may be deserialized based on
content type).
Additionally, this interface recognizes the utility of introspecting a
request to derive and match additional parameters (e.g., via URI path
matching, decrypting cookie values, deserializing non-form-encoded body
content, matching authorization headers to users, etc). These parameters
are stored in an "attributes" property.
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. |
ResponseInterface
|
Representation of an outgoing, server-side response.
Per the HTTP specification, this interface includes properties for
each of the following:
- Protocol version
- Status code and reason phrase
- Headers
- Message body
Responses 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. |
UriInterface
|
Value object representing a URI.
This interface is meant to represent URIs according to RFC 3986 and to
provide methods for most common operations. Additional functionality for
working with URIs can be provided on top of the interface or externally.
Its primary use is for HTTP requests, but may also be used in other
contexts.
Instances of this interface are considered immutable; all methods that
might change state MUST be implemented such that they retain the internal
state of the current instance and return an instance that contains the
changed state.
Typically the Host header will be also be present in the request message.
For server-side requests, the scheme will typically be discoverable in the
server parameters. |
StreamInterface
|
Describes a data stream.
Typically, an instance will wrap a PHP stream; this interface provides
a wrapper around the most common operations, including serialization of
the entire stream to a string. |
RequestInterface
|
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. |
UploadedFileInterface
|
Value object representing a file uploaded through an HTTP request.
Instances of this interface are considered immutable; all methods that
might change state MUST be implemented such that they retain the internal
state of the current instance and return an instance that contains the
changed state. |
MessageInterface
|
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. |
UploadedFileFactoryInterface
|
|
ResponseFactoryInterface
|
|
ServerRequestFactoryInterface
|
|
UriFactoryInterface
|
|
StreamFactoryInterface
|
|
RequestFactoryInterface
|
|