Passing custom props via axios config
Problem
Describe the bug We use some custom parameters via axios configuration. They are used in the response interceptor. Sometimes there may be a lot of information there, so the option to pass it through the `headers` or `params` is not suitable for us because of the length limit To Reproduce - Open: https://jsfiddle.net/w2rmhy4c/1/ - Attach axios 0.18 (uncomment line with `axios@0.18.0`) - Run fiddle (console show true) - Attach axios 0.19 (uncomment line with `axios@0.19.0`) - Run fiddle (console show undefined) Expected behavior Custom config parameter passed. Or the ability to use another config option to pass custom data. Environment: - Axios Version 0.18/0.19 Additional context/Screenshots First messages with axios 0.18, second with 0.19 <img width="975" alt="" src="https://user-images.githubusercontent.com/4497128/61464515-0a48e180-a97f-11e9-8806-d14f173ecba7.png">
Unverified for your environment
Select your OS to check compatibility.
1 Fix
Solution: Passing custom props via axios config
I need this too. I had this working in 0.18 but it stopped working in 0.19 I used something like this: [code block] but it no longer shows up in the interceptor config: [code block] Edit: just confirmed this works in 0.18.1 so I'm reverting back for now
Trust Score
5 verifications
- 1
I need this too. I had this working in 0.18 but it stopped working in 0.19
I need this too. I had this working in 0.18 but it stopped working in 0.19
- 2
I used something like this:
[code block]
- 3
but it no longer shows up in the interceptor config:
[code block]
- 4
Edit: just confirmed this works in 0.18.1 so I'm reverting back for now
Edit: just confirmed this works in 0.18.1 so I'm reverting back for now
Validation
Resolved in axios/axios GitHub issue #2295. Community reactions: 9 upvotes.
Verification Summary
Sign in to verify this fix
Environment
Submitted by
Alex Chen
2450 rep