This module contains actions to perform basic api requests
- Source:
- Tutorials:
Methods
-
apiDelete()
-
Wrapper action for 'apiRequest()' that sets the method to 'delete'. All other parameters are the same.
-
apiGet()
-
Wrapper action for 'apiRequest()' that sets the method to 'get'. All other parameters are the same.
-
apiHead()
-
Wrapper action for 'apiRequest()' that sets the method to 'head'. All other parameters are the same. The HEAD method asks for a response identical to that of a GET request, but without the response body.
-
apiPatch()
-
Wrapper action for 'apiRequest()' that sets the method to 'patch'. All other parameters are the same.
-
apiPost()
-
Wrapper action for 'apiRequest()' that sets the method to 'post'. All other parameters are the same.
-
apiPut()
-
Wrapper action for 'apiRequest()' that sets the method to 'put'. All other parameters are the same.
-
apiRequest(method, actionType, gatewayType, path [, data] [, options] [, actionMeta])
-
Simple wrapper action to execute a gateway request. Will dispatch an async action (action with promise on payload) with additional information about the API call on the meta property.
Parameters:
Name Type Argument Default Description methodstring The request method to use ("get", "post", etc..)
actionTypestring The 'type' property of the dispatched action is set to this value
gatewayTypestring The type of gateway to use. These should be one of the strings defined in Injectables.js
pathstring The path to the endpoint to request
dataobject <optional>
null Object with data to send with the API request
optionsobject <optional>
{} Object with additional options passed to the gateway. Please see the gateway documentation for more information
actionMetaobject <optional>
{} Additional properties to set on the 'meta' property of the action so we can identify the request in our reducers