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

Fonctions membres publiques

 __construct ($options=[], TransportInterface $transport=null)
 
 getOption ($key, $default=null)
 
 setOption ($key, $value)
 
 options ($url, array $headers=[], $timeout=null)
 
 head ($url, array $headers=[], $timeout=null)
 
 get ($url, array $headers=[], $timeout=null)
 
 post ($url, $data, array $headers=[], $timeout=null)
 
 put ($url, $data, array $headers=[], $timeout=null)
 
 delete ($url, array $headers=[], $timeout=null, $data=null)
 
 trace ($url, array $headers=[], $timeout=null)
 
 patch ($url, $data, array $headers=[], $timeout=null)
 
 sendRequest (RequestInterface $request)
 

Fonctions membres protégées

 makeTransportRequest ($method, $url, $data=null, array $headers=[], $timeout=null)
 

Attributs protégés

 $options
 
 $transport
 

Description détaillée

HTTP client class.

Depuis
1.0

Documentation des constructeurs et destructeur

◆ __construct()

__construct (   $options = [],
TransportInterface  $transport = null 
)

Constructor.

Paramètres
array | \ArrayAccess$optionsClient options array. If the registry contains any headers.* elements, these will be added to the request headers.
TransportInterface$transportThe HTTP transport object.
Depuis
1.0
Exceptions

Références Http\$options, Http\$transport, class, et Http\options().

Documentation des fonctions membres

◆ delete()

delete (   $url,
array  $headers = [],
  $timeout = null,
  $data = null 
)

Method to send the DELETE command to the server.

Paramètres
string | UriInterface$urlThe URI to the resource to request.
array$headersAn array of request headers to send with the request.
integer$timeoutRead timeout in seconds.
mixed$dataEither an associative array or a string to be sent with the request.
Renvoie
Response
Depuis
1.0

Références $url, et Http\makeTransportRequest().

◆ get()

get (   $url,
array  $headers = [],
  $timeout = null 
)

Method to send the GET command to the server.

Paramètres
string | UriInterface$urlThe URI to the resource to request.
array$headersAn array of request headers to send with the request.
integer$timeoutRead timeout in seconds.
Renvoie
Response
Depuis
1.0

Références $url, Http\makeTransportRequest(), et null.

◆ getOption()

getOption (   $key,
  $default = null 
)

Get an option from the HTTP client.

Paramètres
string$keyThe name of the option to get.
mixed$defaultThe default value if the option is not set.
Renvoie
mixed The option value.
Depuis
1.0

Références $default, $key, et Http\options().

◆ head()

head (   $url,
array  $headers = [],
  $timeout = null 
)

Method to send the HEAD command to the server.

Paramètres
string | UriInterface$urlThe URI to the resource to request.
array$headersAn array of request headers to send with the request.
integer$timeoutRead timeout in seconds.
Renvoie
Response
Depuis
1.0

Références $url, Http\makeTransportRequest(), et null.

◆ makeTransportRequest()

makeTransportRequest (   $method,
  $url,
  $data = null,
array  $headers = [],
  $timeout = null 
)
protected

Send a request to the server and return a Response object with the response.

Paramètres
string$methodThe HTTP method for sending the request.
string | UriInterface$urlThe URI to the resource to request.
mixed$dataEither an associative array or a string to be sent with the request.
array$headersAn array of request headers to send with the request.
integer$timeoutRead timeout in seconds.
Renvoie
Response
Depuis
1.0
Exceptions

Références $data, $key, $method, $temp, $url, $val, class, elseif, null, et Http\options().

Référencé par Http\delete(), Http\get(), Http\head(), Http\options(), Http\patch(), Http\post(), Http\put(), Http\sendRequest(), et Http\trace().

◆ options()

options (   $url,
array  $headers = [],
  $timeout = null 
)

Method to send the OPTIONS command to the server.

Paramètres
string | UriInterface$urlThe URI to the resource to request.
array$headersAn array of request headers to send with the request.
integer$timeoutRead timeout in seconds.
Renvoie
Response
Depuis
1.0

Références $url, Http\makeTransportRequest(), et null.

Référencé par Http\__construct(), Http\getOption(), Http\makeTransportRequest(), et Http\setOption().

◆ patch()

patch (   $url,
  $data,
array  $headers = [],
  $timeout = null 
)

Method to send the PATCH command to the server.

Paramètres
string | UriInterface$urlThe URI to the resource to request.
mixed$dataEither an associative array or a string to be sent with the request.
array$headersAn array of request headers to send with the request.
integer$timeoutRead timeout in seconds.
Renvoie
Response
Depuis
1.0

Références $url, et Http\makeTransportRequest().

◆ post()

post (   $url,
  $data,
array  $headers = [],
  $timeout = null 
)

Method to send the POST command to the server.

Paramètres
string | UriInterface$urlThe URI to the resource to request.
mixed$dataEither an associative array or a string to be sent with the request.
array$headersAn array of request headers to send with the request.
integer$timeoutRead timeout in seconds.
Renvoie
Response
Depuis
1.0

Références $data, $url, et Http\makeTransportRequest().

◆ put()

put (   $url,
  $data,
array  $headers = [],
  $timeout = null 
)

Method to send the PUT command to the server.

Paramètres
string | UriInterface$urlThe URI to the resource to request.
mixed$dataEither an associative array or a string to be sent with the request.
array$headersAn array of request headers to send with the request.
integer$timeoutRead timeout in seconds.
Renvoie
Response
Depuis
1.0

Références $data, $url, et Http\makeTransportRequest().

◆ sendRequest()

sendRequest ( RequestInterface  $request)

Sends a PSR-7 request and returns a PSR-7 response.

Paramètres
RequestInterface$requestThe PSR-7 request object.
Renvoie
ResponseInterface|Response
Depuis
2.0.0

Implémente ClientInterface.

Références $data, MessageInterface\getBody(), MessageInterface\getHeaders(), RequestInterface\getMethod(), RequestInterface\getUri(), Http\makeTransportRequest(), et null.

◆ setOption()

setOption (   $key,
  $value 
)

Set an option for the HTTP client.

Paramètres
string$keyThe name of the option to set.
mixed$valueThe option value to set.
Renvoie
$this
Depuis
1.0

Références $key, $this, $value, et Http\options().

◆ trace()

trace (   $url,
array  $headers = [],
  $timeout = null 
)

Method to send the TRACE command to the server.

Paramètres
string | UriInterface$urlThe URI to the resource to request.
array$headersAn array of request headers to send with the request.
integer$timeoutRead timeout in seconds.
Renvoie
Response
Depuis
1.0

Références $url, Http\makeTransportRequest(), et null.

Documentation des champs

◆ $options

$options
protected

Référencé par Http\__construct().

◆ $transport

$transport
protected

Référencé par Http\__construct().


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