Constructor
new mw.Rest([options])
#
Create an instance of mw.Rest
.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
options |
mw.Rest.Options |
optional |
See |
- Source:
Methods
abort()
#
Abort all unfinished requests issued by this Api object.
- Source:
Abort all unfinished requests issued by this Api object.
ajax(path, [ajaxOptions]) → {jQuery.Promise}
#
Perform the API call.
Parameters:
- Source:
Returns:
Done: API response data and the jqXHR object. Fail: Error code
- Type
- jQuery.Promise
Perform the API call.
delete(path, body, [headers]) → {jQuery.Promise}
#
Perform REST API DELETE request.
Note: only sending application/json
is currently supported.
Parameters:
- Source:
Returns:
- Type
- jQuery.Promise
Perform REST API DELETE request.
get(path, query, [headers]) → {jQuery.Promise}
#
Perform REST API get request.
post(path, [body], [headers]) → {jQuery.Promise}
#
Perform REST API post request.
Note: only sending application/json is currently supported.
Parameters:
- Source:
Returns:
- Type
- jQuery.Promise
Perform REST API post request.
put(path, body, [headers]) → {jQuery.Promise}
#
Perform REST API PUT request.
Note: only sending application/json
is currently supported.
Parameters:
- Source:
Returns:
- Type
- jQuery.Promise
Perform REST API PUT request.