axios CROS每次请求多一次options请求 axios CROS request two times every time
axios CROS每次请求多一次options请求
case: https://developer.mozilla.org/zh-CN/docs/Web/HTTP/Access_control_CORS
header’s param except for the following
- Accept
- Accept-Language
- Content-Language
- Content-Type (需要注意额外的限制)
- DPR
- Downlink
- Save-Data
- Viewport-Width
- Width
other param make the request become complex requests
config.headers['X-Token'] = getToken() |
here the reason is ‘X-Token’
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 👋Blog!
评论