i
API
Access methods are used to retrieve items or access specific functionalities.
Class methods are specific to each element, facilitating their management and incorporating their own behavior.
Access Method
Name |
Description |
Result |
---|---|---|
$d.getAPI() |
Gets an API object |
API |
Class Methods
Name |
Description |
Result |
---|---|---|
delete(url) |
Makes a DELETE request to the url, using the online user's credentials (token).
Parameter •String url: Rest API path
$d.delete(“https://hostname.com/API/id”) |
Promise<Object> |
get(url) |
Makes a GET request to the url, using the online user's credentials (token).
Parameter •String url: Rest API path
Example:
$d.get(“https://hostname.com/API”) |
Promise<Object> |
patch(url, data) |
Makes a PATCH request to the url, using the credentials (token) of the online user and sending the object received in the “data” parameter in JSON format as a payload.
Parameters •String url: Rest API path •Object data: Object to send in the body of the request
Example:
$d.patch(“https://hostname.com/API/id”, { commentId: 1, commentContent: "Hello!" }) |
Promise<Object> |
post(url, data) |
Makes a POST request to the url, using the credentials (token) of the online user and sending the object received in the “data” parameter in JSON format as a payload.
Parameters •String url: Rest API path •Object data: Object to send in the body of the request
Example:
$d.post(“https://hostname.com/API/id”, { commentId: 1, commentContent: "Hello!" }) |
Promise<Object> |
put(url, data) |
Makes a PUT request to the url, using the credentials (token) of the online user and sending the object received in the “data” parameter in JSON format as a payload.
Parameters •String url : Rest API path •Object data: Object to send in the body of the request
Example:
$d.put(“https://hostname.com/API/id”, { commentId: 1, commentContent: "Hello!" }) |
Promise<Object> |