This article mainly brings you an example of setting header information for vue-resource interceptor. The editor thinks it’s pretty good, so I’ll share it with you now and give it as a reference. Let’s follow the editor to take a look, I hope it can help everyone.
Use vue-resource, set header information:
Vue.http.interceptors.push((request, next) => { request.headers.set('Authorization', token) console.log(request.headers) next(response => { console.log(response.status) return response }) })
Related recommendations:
##Vue2.0 axios front-end and back-end login interceptor
Vue interceptor vue-resource Interceptor usage detailed explanation
WeChat applet development page interceptor detailed explanation
The above is the detailed content of Detailed explanation of vue-resource interceptor setting header. For more information, please follow other related articles on the PHP Chinese website!
How to configure the pycharm environment
Why does my phone keep restarting?
What to do if Linux prompts No such file or directory when executing a file
How to display two divs side by side
win10 bluetooth switch is missing
What does the other party show after being blocked on WeChat?
How to convert nef to jpg format
What are artificial intelligence technologies?