What about custom headers? how do you implement it within you method?
If you need to send custom headers with values that can change with the requests, you can always pass additional arguments to your methods, which can then be passed as part of the config for axios.get, axios.post, etc.
axios.get
axios.post
export default { getComments: (params, language) => { const headers = { 'Accept-Language': language } return axios.get(`${API}/comments`, params, { headers }) } }
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
What about custom headers? how do you implement it within you method?
If you need to send custom headers with values that can change with the requests, you can always pass additional arguments to your methods, which can then be passed as part of the config for
axios.get
,axios.post
, etc.