new IControl(optionsopt)
Creates an IControl object
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
<optional> |
Options for the creation. Properties
|
Methods
create(path, bodyopt, optionsopt) → {Promise}
Executes a create (POST) request
Parameters:
Name | Type | Attributes | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
path |
String | Path for the request. |
|||||||||||||
body |
Object |
<optional> |
Body of the request. |
||||||||||||
options |
Object |
<optional> |
Options for the request. Properties
|
Returns:
A promise which is resolved with the results of the request or rejected if an error occurs.
- Type
- Promise
delete(path, bodyopt, optionsopt) → {Promise}
Executes a delete (DELETE) request
Parameters:
Name | Type | Attributes | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
path |
String | Path for the request. |
|||||||||||||
body |
Object |
<optional> |
Body of the request. |
||||||||||||
options |
Object |
<optional> |
Options for the request. Properties
|
Returns:
A promise which is resolved with the results of the request or rejected if an error occurs. If the response is JSON that has 'items' in it, only the items are returned.
- Type
- Promise
list(path, optionsopt) → {Promise}
Executes a list (GET) request
Parameters:
Name | Type | Attributes | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
path |
String | Path for the request. |
|||||||||||||
options |
Object |
<optional> |
Options for the request. Properties
|
Returns:
A promise which is resolved with the results of the request or rejected if an error occurs. If the response is JSON that has 'items' in it, only the items are returned.
- Type
- Promise
modify(path, bodyopt, optionsopt) → {Promise}
Executes a modify (PATCH) request
Parameters:
Name | Type | Attributes | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
path |
String | Path for the request. |
|||||||||||||
body |
Object |
<optional> |
Body of the request. |
||||||||||||
options |
Object |
<optional> |
Options for the request. Properties
|
Returns:
A promise which is resolved with the results of the request or rejected if an error occurs.
- Type
- Promise
replace(path, bodyopt, optionsopt) → {Promise}
Executes a replace (PUT) request
Parameters:
Name | Type | Attributes | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
path |
String | Path for the request. |
|||||||||||||
body |
Object |
<optional> |
Body of the request. |
||||||||||||
options |
Object |
<optional> |
Options for the request. Properties
|
Returns:
A promise which is resolved with the results of the request or rejected if an error occurs.
- Type
- Promise
request(method, path, bodyopt, optionsopt, existingDeferredopt) → {Promise}
Executes a request
Parameters:
Name | Type | Attributes | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
method |
String | HTTP method for the request. |
|||||||||||||
path |
String | Path for the request. |
|||||||||||||
body |
Object |
<optional> |
Body of the request. |
||||||||||||
options |
Object |
<optional> |
Options for the request. Properties
|
||||||||||||
existingDeferred |
Object |
<optional> |
An existing deferred to use instead of creating a new one. Used for recursion (for retrying the request). |
||||||||||||
options.noRefresh |
Boolean |
<optional> |
Do not try to refresh the auth token if the request gets a 401 |
Returns:
A promise which is resolved with the results of the request or rejected if an error occurs.
- Type
- Promise