Joomla Platform  13.1
Documentation des API du framework Joomla Platform
 Tout Classes Espaces de nommage Fichiers Fonctions Variables Pages
Référence de la classe JHttp
+ Graphe d'héritage de JHttp:

Liste de tous les membres

Fonctions membres publiques

 __construct (JRegistry $options=null, JHttpTransport $transport=null)
 getOption ($key)
 setOption ($key, $value)
 options ($url, array $headers=null, $timeout=null)
 head ($url, array $headers=null, $timeout=null)
 get ($url, array $headers=null, $timeout=null)
 post ($url, $data, array $headers=null, $timeout=null)
 put ($url, $data, array $headers=null, $timeout=null)
 delete ($url, array $headers=null, $timeout=null)
 trace ($url, array $headers=null, $timeout=null)
 patch ($url, $data, array $headers=null, $timeout=null)

Attributs protégés

 $options
 $transport

Description détaillée

Définition à la ligne 19 du fichier http.php.


Documentation des constructeurs et destructeur

JHttp::__construct ( JRegistry  $options = null,
JHttpTransport  $transport = null 
)

Constructor.

Paramètres:
JRegistry$optionsClient options object. If the registry contains any headers.* elements, these will be added to the request headers.
JHttpTransport$transportThe HTTP transport object.
Depuis:
11.3

Réimplémentée dans JGithubHttp, et JMediawikiHttp.

Définition à la ligne 42 du fichier http.php.

Références JHttpFactory\getAvailableDriver().

{
$this->options = isset($options) ? $options : new JRegistry;
$this->transport = isset($transport) ? $transport : JHttpFactory::getAvailableDriver($this->options);
}

+ Voici le graphe d'appel pour cette fonction :


Documentation des fonctions membres

JHttp::delete (   $url,
array  $headers = null,
  $timeout = null 
)

Method to send the DELETE command to the server.

Paramètres:
string$urlPath to the resource.
array$headersAn array of name-value pairs to include in the header of the request.
integer$timeoutRead timeout in seconds.
Renvoie:
JHttpResponse
Depuis:
11.3

Définition à la ligne 257 du fichier http.php.

{
// Look for headers set in the options.
$temp = (array) $this->options->get('headers');
foreach ($temp as $key => $val)
{
if (!isset($headers[$key]))
{
$headers[$key] = $val;
}
}
// Look for timeout set in the options.
if ($timeout === null && $this->options->exists('timeout'))
{
$timeout = $this->options->get('timeout');
}
return $this->transport->request('DELETE', new JUri($url), null, $headers, $timeout, $this->options->get('userAgent', null));
}
JHttp::get (   $url,
array  $headers = null,
  $timeout = null 
)

Method to send the GET command to the server.

Paramètres:
string$urlPath to the resource.
array$headersAn array of name-value pairs to include in the header of the request.
integer$timeoutRead timeout in seconds.
Renvoie:
JHttpResponse
Depuis:
11.3

Définition à la ligne 156 du fichier http.php.

{
// Look for headers set in the options.
$temp = (array) $this->options->get('headers');
foreach ($temp as $key => $val)
{
if (!isset($headers[$key]))
{
$headers[$key] = $val;
}
}
// Look for timeout set in the options.
if ($timeout === null && $this->options->exists('timeout'))
{
$timeout = $this->options->get('timeout');
}
return $this->transport->request('GET', new JUri($url), null, $headers, $timeout, $this->options->get('userAgent', null));
}
JHttp::getOption (   $key)

Get an option from the HTTP client.

Paramètres:
string$keyThe name of the option to get.
Renvoie:
mixed The option value.
Depuis:
11.3

Définition à la ligne 57 du fichier http.php.

{
return $this->options->get($key);
}
JHttp::head (   $url,
array  $headers = null,
  $timeout = null 
)

Method to send the HEAD command to the server.

Paramètres:
string$urlPath to the resource.
array$headersAn array of name-value pairs to include in the header of the request.
integer$timeoutRead timeout in seconds.
Renvoie:
JHttpResponse
Depuis:
11.3

Définition à la ligne 123 du fichier http.php.

{
// Look for headers set in the options.
$temp = (array) $this->options->get('headers');
foreach ($temp as $key => $val)
{
if (!isset($headers[$key]))
{
$headers[$key] = $val;
}
}
// Look for timeout set in the options.
if ($timeout === null && $this->options->exists('timeout'))
{
$timeout = $this->options->get('timeout');
}
return $this->transport->request('HEAD', new JUri($url), null, $headers, $timeout, $this->options->get('userAgent', null));
}
JHttp::options (   $url,
array  $headers = null,
  $timeout = null 
)

Method to send the OPTIONS command to the server.

Paramètres:
string$urlPath to the resource.
array$headersAn array of name-value pairs to include in the header of the request.
integer$timeoutRead timeout in seconds.
Renvoie:
JHttpResponse
Depuis:
11.3

Définition à la ligne 90 du fichier http.php.

{
// Look for headers set in the options.
$temp = (array) $this->options->get('headers');
foreach ($temp as $key => $val)
{
if (!isset($headers[$key]))
{
$headers[$key] = $val;
}
}
// Look for timeout set in the options.
if ($timeout === null && $this->options->exists('timeout'))
{
$timeout = $this->options->get('timeout');
}
return $this->transport->request('OPTIONS', new JUri($url), null, $headers, $timeout, $this->options->get('userAgent', null));
}
JHttp::patch (   $url,
  $data,
array  $headers = null,
  $timeout = null 
)

Method to send the PATCH command to the server.

Paramètres:
string$urlPath to the resource.
mixed$dataEither an associative array or a string to be sent with the request.
array$headersAn array of name-value pairs to include in the header of the request.
integer$timeoutRead timeout in seconds.
Renvoie:
JHttpResponse
Depuis:
12.2

Définition à la ligne 324 du fichier http.php.

{
// Look for headers set in the options.
$temp = (array) $this->options->get('headers');
foreach ($temp as $key => $val)
{
if (!isset($headers[$key]))
{
$headers[$key] = $val;
}
}
// Look for timeout set in the options.
if ($timeout === null && $this->options->exists('timeout'))
{
$timeout = $this->options->get('timeout');
}
return $this->transport->request('PATCH', new JUri($url), $data, $headers, $timeout, $this->options->get('userAgent', null));
}
JHttp::post (   $url,
  $data,
array  $headers = null,
  $timeout = null 
)

Method to send the POST command to the server.

Paramètres:
string$urlPath to the resource.
mixed$dataEither an associative array or a string to be sent with the request.
array$headersAn array of name-value pairs to include in the header of the request
integer$timeoutRead timeout in seconds.
Renvoie:
JHttpResponse
Depuis:
11.3

Définition à la ligne 190 du fichier http.php.

{
// Look for headers set in the options.
$temp = (array) $this->options->get('headers');
foreach ($temp as $key => $val)
{
if (!isset($headers[$key]))
{
$headers[$key] = $val;
}
}
// Look for timeout set in the options.
if ($timeout === null && $this->options->exists('timeout'))
{
$timeout = $this->options->get('timeout');
}
return $this->transport->request('POST', new JUri($url), $data, $headers, $timeout, $this->options->get('userAgent', null));
}
JHttp::put (   $url,
  $data,
array  $headers = null,
  $timeout = null 
)

Method to send the PUT command to the server.

Paramètres:
string$urlPath to the resource.
mixed$dataEither an associative array or a string to be sent with the request.
array$headersAn array of name-value pairs to include in the header of the request.
integer$timeoutRead timeout in seconds.
Renvoie:
JHttpResponse
Depuis:
11.3

Définition à la ligne 224 du fichier http.php.

{
// Look for headers set in the options.
$temp = (array) $this->options->get('headers');
foreach ($temp as $key => $val)
{
if (!isset($headers[$key]))
{
$headers[$key] = $val;
}
}
// Look for timeout set in the options.
if ($timeout === null && $this->options->exists('timeout'))
{
$timeout = $this->options->get('timeout');
}
return $this->transport->request('PUT', new JUri($url), $data, $headers, $timeout, $this->options->get('userAgent', null));
}
JHttp::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:
JHttp This object for method chaining.
Depuis:
11.3

Définition à la ligne 72 du fichier http.php.

{
$this->options->set($key, $value);
return $this;
}
JHttp::trace (   $url,
array  $headers = null,
  $timeout = null 
)

Method to send the TRACE command to the server.

Paramètres:
string$urlPath to the resource.
array$headersAn array of name-value pairs to include in the header of the request.
integer$timeoutRead timeout in seconds.
Renvoie:
JHttpResponse
Depuis:
11.3

Définition à la ligne 290 du fichier http.php.

{
// Look for headers set in the options.
$temp = (array) $this->options->get('headers');
foreach ($temp as $key => $val)
{
if (!isset($headers[$key]))
{
$headers[$key] = $val;
}
}
// Look for timeout set in the options.
if ($timeout === null && $this->options->exists('timeout'))
{
$timeout = $this->options->get('timeout');
}
return $this->transport->request('TRACE', new JUri($url), null, $headers, $timeout, $this->options->get('userAgent', null));
}

Documentation des données membres

JHttp::$options
protected

Définition à la ligne 25 du fichier http.php.

JHttp::$transport
protected

Définition à la ligne 31 du fichier http.php.


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