Modules: apiRequest

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.

Source:

apiGet()

Wrapper action for 'apiRequest()' that sets the method to 'get'. All other parameters are the same.

Source:

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.

Source:

apiPatch()

Wrapper action for 'apiRequest()' that sets the method to 'patch'. All other parameters are the same.

Source:

apiPost()

Wrapper action for 'apiRequest()' that sets the method to 'post'. All other parameters are the same.

Source:

apiPut()

Wrapper action for 'apiRequest()' that sets the method to 'put'. All other parameters are the same.

Source:

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
method string

The request method to use ("get", "post", etc..)

actionType string

The 'type' property of the dispatched action is set to this value

gatewayType string

The type of gateway to use. These should be one of the strings defined in Injectables.js

path string

The path to the endpoint to request

data object <optional>
null

Object with data to send with the API request

options object <optional>
{}

Object with additional options passed to the gateway. Please see the gateway documentation for more information

actionMeta object <optional>
{}

Additional properties to set on the 'meta' property of the action so we can identify the request in our reducers

Source: