Joomla CMS  4.2.2
Documentation des API du CMS Joomla en version 4.2.2
Référence de la classe Request
+ Graphe d'héritage de Request:

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)
 

Description détaillée

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.

Documentation des constructeurs et destructeur

◆ __construct()

__construct (   $uri = null,
string  $method = null,
  $body = 'php://temp',
array  $headers = [] 
)
Paramètres
null | string | UriInterface$uriURI for the request, if any.
null | string$methodHTTP method for the request, if any.
string | resource | StreamInterface$bodyMessage body, if any.
array$headersHeaders for the message, if any.
Exceptions
Exception

Références Laminas\Diactoros\$method, Laminas\Diactoros\$uri, et Laminas\Diactoros\initialize().

Documentation des fonctions membres

◆ getHeader()

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.

Paramètres
string$nameCase-insensitive header field name.
Renvoie
string[] An array of string values as provided for the given header. If the header does not appear in the message, this method MUST return an empty array.
}

Implémente MessageInterface.

Références $header, Laminas\Diactoros\getHostFromUri(), et MessageInterface\hasHeader().

◆ getHeaders()

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.
Renvoie
string[][] Returns an associative array of the message's headers. Each key MUST be a header name, and each value MUST be an array of strings for that header.
}

Implémente MessageInterface.

Références Laminas\Diactoros\getHostFromUri(), et MessageInterface\hasHeader().


La documentation de cette classe a été générée à partir du fichier suivant :