$. ajax Calling twice

Asked

Viewed 94 times

1

I am developing an application with Vue.JS and Jquery. The call is being made like this in Vue:

methods: {
        efetuarLogin: function (event) {
            event.stopPropagation();            
            $.ajax({
                type: 'post',
                crossDomain: true,
                data: JSON.stringify(this.Usuario),
                dataType: 'application/json',
                contentType: 'application/json',
                url: 'http://localhost:5000/api/login',
                complete:function(jqXHR, textStatus){
                    console.log(jqXHR+' - '+textStatus);
                }
            });
            
        }
    },

The call is made twice. One of the returns has the result 204 (No Content). inserir a descrição da imagem aqui

  • 3

    Won’t it be the CORS pre-flight? See if the first one isn’t OPTIONS and the second POST.

  • Hello Sergio. How do I check? By the header verb?

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.