Skip to content

【axios】设置content-type无效的原因 #286

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
smileyby opened this issue Sep 14, 2023 · 1 comment
Open

【axios】设置content-type无效的原因 #286

smileyby opened this issue Sep 14, 2023 · 1 comment

Comments

@smileyby
Copy link
Owner

axios 检测 config.data 是undefined会自动清除content-type

再拦截器中设置的时候可以 将config.data 设置一个空对象

@smileyby
Copy link
Owner Author

源码位置:"axios": "^1.4.0" => node_modules/axios/dist/axios.js => 2193-2201行

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant