PHP Class Remote

Author: Kevin Hutchinson ([email protected])
Inheritance: extends Relating_model, implements Modelled, implements Persisted, implements Validated
Afficher le fichier Open project: getkirby/toolkit Class Usage Examples

Méthodes publiques

Свойство Type Description
$defaults configuration

Protected Properties

Свойство Type Description
$headers all received headers
$options all options for the request
$response store for the response object

Méthodes publiques

Méthode Description
__construct ( string $url, array $options = [] ) Constructor
delete ( string $url, array $params = [] ) : object Static method to send a DELETE request
get ( string $url, array $params = [] ) : object Static method to send a GET request
head ( string $url, array $params = [] ) : object Static method to send a HEAD request
headers ( string $url, array $params = [] ) : array Static method to send a HEAD request which only returns an array of headers
options ( ) : array Returns all options which have been set for the current request
post ( string $url, array $params = [] ) : object Static method to send a POST request
put ( string $url, array $params = [] ) : object Static method to send a PUT request
request ( string $url, array $params = [] ) : object Static method to init this class and send a request
response ( ) : object Returns the response object for the current request

Méthodes protégées

Méthode Description
header ( object $curl, string $header ) : integer Used by curl to parse incoming headers
postfields ( mixed $data ) : mixed Internal method to handle post field data
send ( ) : object Sets up all curl options and sends the request

Method Details

__construct() public méthode

Constructor
public __construct ( string $url, array $options = [] )
$url string
$options array

delete() public static méthode

Static method to send a DELETE request
public static delete ( string $url, array $params = [] ) : object
$url string
$params array
Résultat object Response

get() public static méthode

Static method to send a GET request
public static get ( string $url, array $params = [] ) : object
$url string
$params array
Résultat object Response

head() public static méthode

Static method to send a HEAD request
public static head ( string $url, array $params = [] ) : object
$url string
$params array
Résultat object Response

header() protected méthode

Used by curl to parse incoming headers
protected header ( object $curl, string $header ) : integer
$curl object the curl connection
$header string the header line
Résultat integer the length of the heade

headers() public static méthode

Static method to send a HEAD request which only returns an array of headers
public static headers ( string $url, array $params = [] ) : array
$url string
$params array
Résultat array

options() public méthode

Returns all options which have been set for the current request
public options ( ) : array
Résultat array

post() public static méthode

Static method to send a POST request
public static post ( string $url, array $params = [] ) : object
$url string
$params array
Résultat object Response

postfields() protected méthode

Internal method to handle post field data
protected postfields ( mixed $data ) : mixed
$data mixed
Résultat mixed

put() public static méthode

Static method to send a PUT request
public static put ( string $url, array $params = [] ) : object
$url string
$params array
Résultat object Response

request() public static méthode

Static method to init this class and send a request
public static request ( string $url, array $params = [] ) : object
$url string
$params array
Résultat object Response

response() public méthode

Returns the response object for the current request
public response ( ) : object
Résultat object Response

send() protected méthode

Sets up all curl options and sends the request
protected send ( ) : object
Résultat object Response

Property Details

$defaults public_oe static_oe property

configuration
public static $defaults

$headers protected_oe property

all received headers
protected $headers

$options protected_oe property

all options for the request
protected $options

$response protected_oe property

store for the response object
protected $response