new mw.Rest(optionsopt)
#
Constructor to create an object to interact with the REST API of a particular MediaWiki server. mw.Rest objects represent the REST API of a particular MediaWiki server.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
options |
mw.Rest.Options |
<optional> |
See |
- Source:
Constructor to create an object to interact with the REST API of a particular MediaWiki server.
Methods
abort()
#
Abort all unfinished requests issued by this Api object.
- Source:
Abort all unfinished requests issued by this Api object.
ajax(path, ajaxOptionsopt) → {jQuery.Promise}
#
Perform the API call.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
path |
string | ||
ajaxOptions |
Object |
<optional> |
- Source:
Returns:
Done: API response data and the jqXHR object. Fail: Error code
- Type
- jQuery.Promise
Perform the API call.
delete(path, body, headersopt) → {jQuery.Promise}
#
Perform REST API DELETE request.
Note: only sending application/json
is currently supported.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
path |
string | ||
body |
Object | ||
headers |
Object |
<optional> |
- Source:
Returns:
- Type
- jQuery.Promise
Perform REST API DELETE request.
get(path, query, headersopt) → {jQuery.Promise}
#
Perform REST API get request.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
path |
string | ||
query |
Object | ||
headers |
Object |
<optional> |
- Source:
Returns:
- Type
- jQuery.Promise
Perform REST API get request.
post(path, bodyopt, headersopt) → {jQuery.Promise}
#
Perform REST API post request.
Note: only sending application/json is currently supported.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
path |
string | ||
body |
Object |
<optional> |
|
headers |
Object |
<optional> |
- Source:
Returns:
- Type
- jQuery.Promise
Perform REST API post request.
put(path, body, headersopt) → {jQuery.Promise}
#
Perform REST API PUT request.
Note: only sending application/json
is currently supported.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
path |
string | ||
body |
Object | ||
headers |
Object |
<optional> |
- Source:
Returns:
- Type
- jQuery.Promise
Perform REST API PUT request.