2
0
mirror of https://github.com/tenrok/axios.git synced 2026-05-15 11:59:42 +03:00

fix(types): allow to specify partial default headers for instance creation (#4185)

Co-authored-by: Jay <jasonsaayman@gmail.com>
This commit is contained in:
Lukas Hroch
2022-05-09 19:03:05 +01:00
committed by GitHub
parent 356b166182
commit ac96144dd3
2 changed files with 10 additions and 1 deletions
+5
View File
@@ -263,6 +263,11 @@ instance1.defaults.headers.common['Authorization'] = 'token';
instance1.defaults.headers.post['X-FOO'] = 'bar';
instance1.defaults.timeout = 2500;
// axios create defaults
axios.create({ headers: { foo: 'bar' } });
axios.create({ headers: { common: { foo: 'bar' } } });
// Interceptors
const requestInterceptorId: number = axios.interceptors.request.use(