RESTClient class (from v2.6.0)

The following sections explain each method of the class.

call


public mixed call(string $url, string $method = 'GET', array $data = array(), array $params = array())

With the call method, you can easily send a CURL radical request to a URL that data. What form of transmission, the parameter specifies method laid.

Parameter list
url

Here, enter the URL that you want to communicate.

method

The transmission method is to have the cURL radical request. The options are: GET, POST, PUT and DELETE

data

An array / associative array with data to be transmitted to the requested URL.

params

Parameters to be appended to the call of the URL.


get


public mixed get(string $url, array $params = array())

The difference with the call method is here directly send a GET request cURL rest and not have to define only by what method it is.

Parameter list
url

The URL to which the rest cURL GET request to send.

params

The GET parameters to be communicated with.


post


public mixed post(string $url, array $data = array(), array $params = array())

The difference with the call method is you, right here, a POST request Send cURL rest and not have to define only by what method it is.

Parameter list
url

The URL to which the rest CURL POST request to send.

data

An associative array is to be submitted via POST.

params

The GET parameters to be communicated with.


put


public mixed put(string $url, array $data = array(), array $params = array())

The difference with the call method is here directly send a PUT request cURL rest and not have to define only by what method it is.

Parameter list
url

The URL to which the rest cURL PUT request to send.

data

An associative array is to be submitted via POST.

params

The GET parameters to be communicated with.


delete


public mixed delete(string $url, array $params = array())

The difference with the call method is the need to define here directly send a DELETE request cURL rest and not only about which method is.

Parameter list
url

The URL to which the rest cURL DELETE request to send.

params

The GET parameters to be communicated with.