Joomla CMS
4.2.2
Documentation des API du CMS Joomla en version 4.2.2
|
Fonctions membres publiques | |
__construct ($uri=null, string $method=null, $body='php://temp', array $headers=[]) | |
getHeaders () | |
getHeader ($header) | |
Fonctions membres publiques hérités de RequestInterface | |
getRequestTarget () | |
withRequestTarget ($requestTarget) | |
getMethod () | |
withMethod ($method) | |
getUri () | |
withUri (UriInterface $uri, $preserveHost=false) | |
Fonctions membres publiques hérités de MessageInterface | |
getProtocolVersion () | |
withProtocolVersion ($version) | |
hasHeader ($name) | |
getHeaderLine ($name) | |
withHeader ($name, $value) | |
withAddedHeader ($name, $value) | |
withoutHeader ($name) | |
getBody () | |
withBody (StreamInterface $body) | |
HTTP Request encapsulation
Requests are considered immutable; all methods that might change state are implemented such that they retain the internal state of the current message and return a new instance that contains the changed state.
null | string | UriInterface | $uri | URI for the request, if any. |
null | string | $method | HTTP method for the request, if any. |
string | resource | StreamInterface | $body | Message body, if any. |
array | $headers | Headers for the message, if any. |
Exception |
Références Laminas\Diactoros\$method, Laminas\Diactoros\$uri, et Laminas\Diactoros\initialize().
getHeader | ( | $header | ) |
{Retrieves a message header value by the given case-insensitive name.This method returns an array of all the header values of the given case-insensitive header name.If the header does not appear in the message, this method MUST return an empty array.
string | $name | Case-insensitive header field name. |
Implémente MessageInterface.
Références $header, Laminas\Diactoros\getHostFromUri(), et MessageInterface\hasHeader().
getHeaders | ( | ) |
{Retrieves all message header values.The keys represent the header name as it will be sent over the wire, and each value is an array of strings associated with the header.
// Represent the headers as a string foreach ($message->getHeaders() as $name => $values) { echo $name . ": " . implode(", ", $values); } // Emit headers iteratively: foreach ($message->getHeaders() as $name => $values) { foreach ($values as $value) { header(sprintf('%s: %s', $name, $value), false); } }While header names are not case-sensitive, getHeaders() will preserve the exact case in which headers were originally specified.
Implémente MessageInterface.
Références Laminas\Diactoros\getHostFromUri(), et MessageInterface\hasHeader().