DELETE request Ajax in a Floodlight SDN controller

86 views Asked by At

I have a function in my JavaScript that makes an Ajax request to the REST interface of a Floodlight controller.

function excluir(nome)
{
    var jsonExclui = ("{" + '"name": "'+nome+'" }');
    alert(jsonExclui);
    $.ajax(
    {
        url: "http://192.168.56.99:8085/wm/staticflowpusher/json",
        method: "DELETE",
        //  type: 'DELETE',
        data: jsonExclui,
        dataType: "json",
        success: function(data)
        {
            alert(data.status);
        },
        error: function(data)
        {
            alert("Deu erro : "+data.status);
        }
    });
}

The DELETE method is accepted and appears in the SDN controller documentation.

https://floodlight.atlassian.net/wiki/pages/viewpage.action?pageId=1343518

But when analyzing the browser console realized he tells me that I'm sending OPTIONS and not DELETE.

Remote Address:192.168.56.99:8085 Request URL:'http:192.168.56.99:8085/wm/staticflowpusher/json' Request Method:OPTIONS Status Code:405 Method Not Allowed

Accept-Ranges:bytes Allow:DELETE, POST Connection:keep-alive Content-Type:application/json Date:Thu, 14 May 2015 11:46:43 GMT Server:Restlet-Framework/2.3.1 Transfer-Encoding:chunked

There is some method to make the browser do not do this pre-request OPTIONS?

0

There are 0 answers