Skip to content

Home > @world-wide-lab/client > Client > call

Client.call() method

Call an endpoint at the API server

Signature:

typescript
call(method: HTTPMethod, endpoint: string, data?: Object, options?: Object): Promise<Response>;

Parameters

Parameter

Type

Description

method

HTTPMethod

Which HTTP method to use: GET, POST or PUT

endpoint

string

The endpoint to call, e.g. /participant/

data

Object

(Optional) The data to send to the server (optional)

options

Object

(Optional) Additional options to use

**Returns:**

Promise<Response>

The JSON body of the response from the server