You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Send a request to the endpoint with specified parameters.
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
Returns
XMLHttpRequest | null: Return XMLHttpRequest if request is sent
via XMLHttpRequest. Return null if request is not sent
via XMLHttpRequest (e.g. sent via iframe).
Example
varverb='GET',route='/sites/1/entries',query={search: 'QUERY'};api.request(verb,route,query,function(response){// Do stuff});