Menu

## RestClient
in package

RestClient.php : 19

RestClient.

##### Tags

author

  Lucas S. Vieira

### Table of Contents

#### Methods

__construct() : mixed
  RestClient constructor.
customHttpRequest() : ResponseInterface
  Makes a custom HTTP request.
delete() : ResponseInterface
  Performs a DELETE request.
get() : ResponseInterface
  Performs a GET request.
patch() : ResponseInterface
  Performs a PATCH request
post() : ResponseInterface
  Performs a POST request.
put() : mixed|ResponseInterface
  Performs a PUT request.

### Methods

#### __construct()

RestClient.php : 39

RestClient constructor.

`public __construct(string $baseUri[, array<string|int, mixed> $options = [] ]) : mixed`

##### Parameters

$baseUri : string

  Base URI for all requests.

$options : array<string|int, mixed> = []

  Base options for all requests.

##### Tags

throws
  InvalidParameterException

  If the base URI is invalid.

#### customHttpRequest()

RestClient.php : 148

Makes a custom HTTP request.

`public customHttpRequest(string $method, string $url[, string $body = "" ][, array<string|int, mixed> $headers = [] ]) : ResponseInterface`

##### Parameters

$method : string

  HTTP method to use.

$url : string

  URL to request.

$body : string = ""

  Body to be sent.

$headers : array<string|int, mixed> = []

  Additional headers.

##### Tags

throws
  GuzzleException

##### Return values

ResponseInterface

#### delete()

RestClient.php : 130

Performs a DELETE request.

`public delete(string $url[, mixed $data = [] ][, array<string|int, mixed> $headers = [] ]) : ResponseInterface`

##### Parameters

$url : string

  URL to execute request.

$data : mixed = []

  Data to send.

$headers : array<string|int, mixed> = []

  Additional headers.

##### Tags

throws
  GuzzleException

##### Return values

ResponseInterface

#### get()

RestClient.php : 62

Performs a GET request.

`public get(string $url[, mixed $data = [] ][, array<string|int, mixed> $headers = [] ]) : ResponseInterface`

##### Parameters

$url : string

  URL to execute request.

$data : mixed = []

  Data to send.

$headers : array<string|int, mixed> = []

  Additional headers.

##### Tags

throws
  GuzzleException

##### Return values

ResponseInterface

#### patch()

RestClient.php : 113

Performs a PATCH request

`public patch(string $url[, mixed $data = [] ][, array<string|int, mixed> $headers = [] ]) : ResponseInterface`

##### Parameters

$url : string

  URL to execute request

$data : mixed = []

  Data to send

$headers : array<string|int, mixed> = []

  Additional headers.

##### Tags

throws
  GuzzleException

##### Return values

ResponseInterface

#### post()

RestClient.php : 79

Performs a POST request.

`public post(string $url[, mixed $data = [] ][, array<string|int, mixed> $headers = [] ]) : ResponseInterface`

##### Parameters

$url : string

  URL to execute request.

$data : mixed = []

  Data to send.

$headers : array<string|int, mixed> = []

  Additional headers.

##### Tags

throws
  GuzzleException

##### Return values

ResponseInterface

#### put()

RestClient.php : 96

Performs a PUT request.

`public put(string $url[, mixed $data = [] ][, array<string|int, mixed> $headers = [] ]) : mixed|ResponseInterface`

##### Parameters

$url : string

  URL to execute request.

$data : mixed = []

  Data to send.

$headers : array<string|int, mixed> = []

  Additional headers.

##### Tags

throws
  GuzzleException

##### Return values

mixed|ResponseInterface

## Search results