Skip to main content

Zymba Documentation

REST.Client​

Text
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​

CODE
$this.construct(string $url, ?function $callback_request, ?function $callback_response, int $timeout, bool $validate): void
Parameters​
NameTypeValueDefault
urlstring""
callback_request?functionpass through
callback_response?functionuniversal handler
timeoutint60
validatebooltrue
CODE
$this.bind(string $route, string $method, object $headers): function
Parameters​
NameTypeValueDefault
routestring""
methodstring"GET"
headersobject[name: value, ...][]
Returns​
TypeValue
function
CODE
$this.call(string $route, string $method, object $headers, variadic $arguments): mixed
Parameters​
NameTypeValueDefault
routestring""
methodstring"GET"
headersobject[name: value, ...][]
argumentsvariadic...
Returns​
TypeValue
mixed
CODE
$this.setLocation(string $url): this
Parameters​
NameTypeValueDefault
urlstring""
Returns​
TypeValue
$this
CODE
$this.setTimeout(int $timeout): this
Parameters​
NameTypeValueDefault
timeoutint60
Returns​
TypeValue
$this
CODE
$this.setValidate(bool $validate): this
Parameters​
NameTypeValueDefault
validatebooltrue
Returns​
TypeValue
$this