-
Notifications
You must be signed in to change notification settings - Fork 5
DataAPI SDK english MT.DataAPI Core method request
Taku AMANO edited this page Jul 9, 2013
·
2 revisions
Send a request to the endpoint with specified parameters.
Name | Type | Required | Description |
---|---|---|---|
method | String | yes | Request method |
endpoint | String | yes | Endpoint to request |
queryParameter | String | Object | no | |
requestData | String | Object | HTMLFormElement | FormData | no | |
requestData.{the-key-requires-json-text} | String | Object | HTMLFormElement | no | Can specify json-text value by string or object or HTMLFormElement. Serialize automatically if object or HTMLFormElement is passed. |
requestData.{the-key-requires-file} | HTMLInputElement | File | no | Can specify file value by HTMLInputElement or File object. |
callback | Function | no |
XMLHttpRequest | null: Return XMLHttpRequest if request is sent via XMLHttpRequest. Return null if request is not sent via XMLHttpRequest (e.g. sent via iframe).
var verb = 'GET',
route = '/sites/1/entries',
query = {
search: 'QUERY'
};
api.request(verb, route, query, function(response) {
// Do stuff
});