vue-resource
vue-resource copied to clipboard
Adding an 'options' action.
Hi. This is a tricky thing, and I am skeptical about its acceptance success, but who knows?
The main goal of this PR is to add an options
method, similarly to get
and others. I am aware of the CORS options preflight requests. But still, I am trying to auto-document my REST apis through the overlooked OPTIONS method. In other words, I want to make specific OPTIONS
requests to my API.
I have tried to use the creation of resources. But I spent hours trying to change headers of existing resources (to set the Authorisation
header), to no avail. Once the resource is made, I couldn't find a way to change its headers. I use the global accessor Vue.http
inside a vuex
module to make my API requests.
The only solution I found is to add the method I need directly inside vue-resource
.
If you have any better idea on how to deal with this, I'll be happy to hear about it! Thanks anyway.
@steffans Any ideas for implement OPTIONS method?