[Vuejs]-Axios put Not working

0👍

It’s not so clear from your question what exactly you are trying to ask. I’ll assume you want your PUT request to actually send a PUT request instead of just an OPTIONS request. I’m also assuming that you are making requests to an API that you control.

I had the same problem (i.e. I was only seeing OPTIONS requests when I tried to make PUT calls) and I discovered that in my API I did not have the PUT options enabled in my CORS settings. I’m using rails so all I had to do is add :put to my cors middleware:

config.middleware.insert_before 0, Rack::Cors do
  allow do
    origins '*'
    resource '*', :headers => :any, :methods => [:get, :post, :put, :options]
  end
end

I figured this out based on this answer

Leave a comment