pagekit / vue-resource

The HTTP client for Vue.js
MIT License
10.09k stars 1.6k forks source link

Options without headers #557

Open bianchin opened 7 years ago

bianchin commented 7 years ago

When I call a POST method, should not it also send the same HEADERS in OPTIONS?

Vue.http.headers.common['Authorization'] = 'Basic YXBpOnBhc3N3b3Jk'

I need to send the HEADER authorization along with OPTIONS but it does not send any additional HEADER

It would be for authentication. Or what best practice for this?

Follow the code below

const params = { 'grant_type': 'password', 'username': creds.username, 'password': creds.password } Vue.http.post(LOGIN_URL, params)

I also tried to send next to the method

Vue.http.post(LOGIN_URL, params, AUTH_BASIC_HEADERS)

thanks

turbo5 commented 7 years ago

Any solutions on this? I tried to add in the .post() method and in the interceptor as well, if the method is POST, with no luck so far