Ajax GET Autocomplete Problem

0

I have the following function, which does a GET for my API:

 function filmeBusca() {

            var prefixo = $('#buscaFilme').val();
            $("[id$=buscaFilme]").autocomplete({
                source: function (request, response) {
                    $.ajax({
                        url: 'http://localhost:62828/api/Filmes/GetFilmes/',
                        data: funfa,
                        dataType: "json",
                        type: "GET",
                        contentType: "application/json; charset=utf-8",
                        success: function (data) {
                            response($.map(data, function (item) {
                                return { label: item.idFilme, value: item.nrDuracao };
                            }))

                        },
                        error: function (response) {
                            alert(response.responseText);
                        },
                        failure: function (response) {
                            alert(response.responseText);
                        }
                    });

                    console.log(prefixo);
                },
                minLength: 1
            });
};

But the get should go this way: link only in my ajax, is going with an interrogation before the term, which does not let it work. It's going like this: link how to fix this?

    
asked by anonymous 01.03.2018 / 02:41

0 answers