Methods
-
delete(path, params, handlers, options)
-
Perform a DELETE request to WonderPush REST API.
Parameters:
Name Type Description pathstring API endpoint path
paramsobject key/value pair of query string parameters
handlersWonderPushSDK.Rest.Handlers request callbacks
optionsobject Options
Properties
Name Type Description fetchbool Whether to use the Fetch API or stick with XHR (if available)
-
fetch(method, path, params, body)
-
Use the Fetch API call to retrieve data.
Parameters:
Name Type Description methodstring "GET" or "POST"
pathstring API endpoint path
paramsobject key/value pair of query string parameters
bodymixed (not implemented)
Returns:
Promise
-
get(path, params, handlers, options)
-
Perform a GET request to WonderPush REST API.
Parameters:
Name Type Description pathstring API endpoint path
paramsobject key/value pair of query string parameters
handlersWonderPushSDK.Rest.Handlers request callbacks
optionsobject Options
Properties
Name Type Description fetchbool Whether to use the Fetch API or stick with XHR (if available)
-
patch(path, params, body, handlers, options)
-
Perform a PATCH request to WonderPush REST API.
Parameters:
Name Type Description pathstring API endpoint path
paramsobject key/value pair of query string parameters
bodymixed (not implemented)
handlersWonderPushSDK.Rest.Handlers request callbacks
optionsobject Options
Properties
Name Type Description fetchbool Whether to use the Fetch API or stick with XHR (if available)
-
post(path, params, body, handlers, options)
-
Perform a POST request to WonderPush REST API.
Parameters:
Name Type Description pathstring API endpoint path
paramsobject key/value pair of query string parameters
bodymixed (not implemented)
handlersWonderPushSDK.Rest.Handlers request callbacks
optionsobject Options
Properties
Name Type Description fetchbool Whether to use the Fetch API or stick with XHR (if available)
-
postBeacon(path, params, session)
-
Perform a POST request to WonderPush REST API using navigator.sendBeacon.
Parameters:
Name Type Description pathstring paramsobject sessionsession Optional
Returns:
Resolves to true when navigator.sendBeacon was able to queue the transfer
- Type
- Promise
-
postEventually(path, params, body)
-
Perform a POST request to WonderPush REST API without an accessToken and ensure it goes to the server. No handler is possible for postEventually.
Parameters:
Name Type Description pathstring API endpoint path
paramsobject key/value pair of query string parameters
bodymixed (not implemented)
-
postEventually(path, params, body)
-
Perform a POST request to WonderPush REST API and ensure it goes to the server. No handler is possible for postEventually.
Parameters:
Name Type Description pathstring API endpoint path
paramsobject key/value pair of query string parameters
bodymixed (not implemented)
Returns:
Promise
resolving until user consent is given and call has been persisted as to be made -
put(path, params, body, handlers, options)
-
Perform a PUT request to WonderPush REST API.
Parameters:
Name Type Description pathstring API endpoint path
paramsobject key/value pair of query string parameters
bodymixed (not implemented)
handlersWonderPushSDK.Rest.Handlers request callbacks
optionsobject Options
Properties
Name Type Description fetchbool Whether to use the Fetch API or stick with XHR (if available)
Type Definitions
-
Handlers
-
WonderPush object to handle request responses.
Callback functions are called in the scope (this keyword) of the
XMLHttpRequestobject when available or the window object otherwise.Type:
- Object
- See:
Properties:
Name Type Description onloadfunction onerrorfunction ontimeoutfunction onabortfunction onloadendfunction