Please enable JavaScript.
Coggle requires JavaScript to display documents.
Axios - Coggle Diagram
Axios
configuring
essentials
route specific
baseURL
params
authentication helper
withCredentials
headers
data tansformer
(middlewares)
transformRequest
transformResponse
others
cancelToken
timeout
onUploadProgress
allows you to configure many essential things
for example baseURL
response object
contains
data
status
statusText
headers
config
request
note
if error, the error wraps the response object
i.e
error.response.data
interceptors
similar to middleware
modifies config only
canceling request
CancelToken
assigned to call's config of
cancelToken
could be implemented to many calls
call cancel method to cancel
good api call architecture
component
action
middleware
api call
dispatch to reducer
store