Axios-module: How to set axios.defaults.xxx?

Created on 6 Sep 2017  路  2Comments  路  Source: nuxt-community/axios-module

Hi,
Thanks for the great module!

How do I set global defaults to all axios requests?
For example:

axios.defaults.xsrfHeaderName = 'X-CSRF-TOKEN'

Thanks!!!

This feature request is available on Nuxt.js community (#c20)
enhancement

Most helpful comment

Hi. init option support added please upgrade to v4.1.0 & check the docs. (BTW 'X-CSRF-TOKEN' is already default in axios so not needed to specify)

All 2 comments

Hi. init option support added please upgrade to v4.1.0 & check the docs. (BTW 'X-CSRF-TOKEN' is already default in axios so not needed to specify)

WOW! That was super fast!!!
Tried v4.1.1 and works great!
Thank you so much!!!
(BTW the default is X-XSRF-TOKEN, but I saw you implemented some tests so you must already found out XD)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ruudboon picture ruudboon  路  5Comments

lsbyerley picture lsbyerley  路  4Comments

mclighter picture mclighter  路  3Comments

lyzs90 picture lyzs90  路  4Comments

chrislentz picture chrislentz  路  3Comments