---
title: "REST.Client"
description: "RESTful client prototype."
canonical_url: "https://www.zeyos.com/zymba/ref/rest/rest-client"
markdown_url: "https://www.zeyos.com/ai/guide/zymba/ref/rest/rest-client.md"
section: "zymba-reference"
authority: "reference"
language: "en"
source_repository: "https://cloud.zeyos.com/__doc/zymbaref.json"
source_sha256: "05a361c6ddc32e74f4a6dc16fd06f218210ff1b7ce57f26ca1994bfffc407915"
---

# REST.Client

## REST.Client

```
object @REST.Client(@Base) {
	construct(string $url, ?function $callback_request, ?function $callback_response, int $timeout, bool $validate) {}
	bind(string $route, string $method, object $headers): function {}
	call(string $route, string $method, object $headers, ...$arguments): mixed {}
	setLocation(string $url): $this {}
	setTimeout(int $timeout): $this {}
	setValidate(bool $validate): $this {}
}
```

**RESTful client prototype.**

### Prototype

**[Base](#)**

## Methods


### `$this.construct()`


```code
$this.construct(string $url, ?function $callback_request, ?function $callback_response, int $timeout, bool $validate): void
```

##### Parameters

| Name | Type | Value | Default |
| --- | --- | --- | --- |
| url | `string`  |  | "" |
| callback_request | `?function`  |  | pass through |
| callback_response | `?function`  |  | universal handler |
| timeout | `int`  |  | 60 |
| validate | `bool`  |  | true |




### `$this.bind()`


```code
$this.bind(string $route, string $method, object $headers): function
```

##### Parameters

| Name | Type | Value | Default |
| --- | --- | --- | --- |
| route | `string`  |  | "" |
| method | `string`  |  | "GET" |
| headers | `object`  | [name: value, ...] | [] |

##### Returns

| Type | Value |
| --- | ---  |
| `function` |  |




### `$this.call()`


```code
$this.call(string $route, string $method, object $headers, variadic $arguments): mixed
```

##### Parameters

| Name | Type | Value | Default |
| --- | --- | --- | --- |
| route | `string`  |  | "" |
| method | `string`  |  | "GET" |
| headers | `object`  | [name: value, ...] | [] |
| arguments | `variadic`  |  | ... |

##### Returns

| Type | Value |
| --- | ---  |
| `mixed` |  |




### `$this.setLocation()`


```code
$this.setLocation(string $url): this
```

##### Parameters

| Name | Type | Value | Default |
| --- | --- | --- | --- |
| url | `string`  |  | "" |

##### Returns

| Type | Value |
| --- | ---  |
| `$this` |  |




### `$this.setTimeout()`


```code
$this.setTimeout(int $timeout): this
```

##### Parameters

| Name | Type | Value | Default |
| --- | --- | --- | --- |
| timeout | `int`  |  | 60 |

##### Returns

| Type | Value |
| --- | ---  |
| `$this` |  |




### `$this.setValidate()`


```code
$this.setValidate(bool $validate): this
```

##### Parameters

| Name | Type | Value | Default |
| --- | --- | --- | --- |
| validate | `bool`  |  | true |

##### Returns

| Type | Value |
| --- | ---  |
| `$this` |  |
