HTTP requests using Axios

Axios (https://github.com/axios/axios) is a Promise-based HTTP client. It is a powerful and flexible library with a very straightforward API. It is used to fetch data from the JHipster application's server-side REST endpoints from Redux actions. The resulting Promise is resolved by the Redux Promise Middleware to provide data to the reducer.

The following shows a Redux action with an asynchronous payload:

export const getRoles = () => ({
type: ACTION_TYPES.FETCH_ROLES,
payload: axios.get(`${apiUrl}/authorities`)
});