Home > doofinder > Client > request
Client.request() method
Perform a request to a HTTP resource.
Signature:
request(resource: string, params?: Record<string, any>, payload?: Record<string, any>, method?: Method): Promise<Response>;
Parameters
Parameter | Type | Description |
---|---|---|
resource | string | The resource to request. |
params | Record<string, any> | An object with the parameters to serialize in the URL querystring. Optional. |
payload | Record<string, any> | Optional. |
method | Method | The method, by default will be GET. Optional. |
Returns:
Promise<Response>
A promise to be fullfilled with the response or rejected with a ClientResponseError
.
Remarks
If a payload is provided the request will be done via POST
instead of GET
.