DELETE Ajax Request on an SDN Floodlight Controller

2

I have a function in my JavaScript that makes an Ajax request for 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 supported and is documented in the SDN driver documentation.

Documentation1

Documentation2

But when analyzing the browser console I noticed that it tells me that I am sending OPTIONS and not DELETE.

  

Accept-Ranges: Allow bytes: 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   Remote Address: 192.168.56.99: 8085 Request   URL: link Request   Method: OPTIONS Status Code: 405 Method Not Allowed

Is this common?

    
asked by anonymous 16.06.2015 / 03:28

1 answer

1

switch may be missing, like this:

curl -X DELETE -d'{"name":"myflow1", "switch":"00:00:04:f0:21:11:3d:78"}' http://192.168.0.220:8080/wm/staticflowpusher/json
    
16.06.2015 / 19:58