Methods
(static) delete(path) → {Promise}
- Description:
Delete Record
Example
await rest.delete('customer/1234')
Parameters:
Name | Type | Description |
---|---|---|
path |
string | Path |
Returns:
- Type
- Promise
(static) get(path, params, Responsenullable) → {Promise.<object>}
- Description:
Read Record
Example
var data = await rest.get('customer/1234')
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
path |
string | Path |
|
params |
object | Params |
|
Response |
string |
<nullable> |
Type |
Returns:
- Type
- Promise.<object>
(static) post(path, Data) → {Promise}
- Description:
Create Record
Example
await rest.post('customer', {name: 'Joe Blogs'}})
Parameters:
Name | Type | Description |
---|---|---|
path |
string | Path |
Data |
object | Data |
Returns:
- Type
- Promise
(static) put(path, data) → {Promise}
- Description:
Update Record
Example
await rest.put('customer/1234', {name: 'Alice'})
Parameters:
Name | Type | Description |
---|---|---|
path |
string | Path |
data |
object | Data |
Returns:
- Type
- Promise