0

I would like to send a request to remove something on server. I know that the difference between POST/GET is that it will be called only once, even when i try to delete the same thing a few times. The data I want to send is:

var data = {
    id: "sht56uyy99",
    names: ["john", "katherine", "jack", "angelina"],
    logged: true,
    number: 235
}

How to send this dictionary in $.ajax() ?

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Bartłomiej Semańczyk
  • 59,234
  • 49
  • 233
  • 358
  • You've misunderstood something. The browser won't block a similar PUT or DELETE query even if it's called multiple times. – JJJ Jan 13 '15 at 12:55
  • possible duplicate of [How to send a PUT/DELETE request in jQuery?](http://stackoverflow.com/questions/2153917/how-to-send-a-put-delete-request-in-jquery) – JJJ Jan 13 '15 at 12:55
  • Change the `type` attribute to PUT or DELETE – Michael Laffargue Jan 13 '15 at 12:56
  • According to this [site](http://www.artima.com/lejava/articles/why_put_and_delete.html): `With PUT and DELETE, there's a big difference between zero requests and one, but there's no difference between one request and ten.` – Bartłomiej Semańczyk Jan 13 '15 at 13:00
  • I mean: how to pass a dictionary to the `data:`. I know that i can do sth like that: "a=valuea&b=valueb&c=valuec", but this is not possible in this case. – Bartłomiej Semańczyk Jan 13 '15 at 13:02

0 Answers0