RM64
RM64

Reputation: 69

Axios post works, Axios put doesn't get past preload request

Axios put won't get past preload request, but if I change it to post, the request does send.

This is my code. In the network tab OPTIONS shows, but on post, it sends OPTIONS and POST.

handleSubmit() {
                axios.put(process.env.VUE_APP_API_BASE + 'auth/password', {
                  password: this.password,
                  password_confirmation: this.password_confirmation,
                  current_password: this.current_password
                })
            }

What could be causing the PUT request to not send?

For both PUT and POST, the OPTIONS request returns code 200

Upvotes: 0

Views: 330

Answers (1)

Radu Diță
Radu Diță

Reputation: 14171

Check your OPTIONS response. Most likely PUT is missing from the list of accepted method requests. Check the Access-Control-Request-Method header values.

More about access control request methods here

Upvotes: 1

Related Questions