-10

For ajax queries, the jquery team don't seem to support put/delete. They are reasonably simple to implement, and they are, technically the preferred option for idempotent tasks.

Was the reason (presumably not technical, because it is so easy to implement) made because the jQuery team question the value of put/delete, or for some other reason?

REFERENCED ANSWERS ONLY

bharal
  • 15,461
  • 36
  • 117
  • 195
  • 1
    [It doesn't support them?](https://stackoverflow.com/questions/2153917/how-to-send-a-put-delete-request-in-jquery) – VLAZ Jan 21 '20 at 15:32
  • 3
    I wont answer! No references :) –  Jan 21 '20 at 15:34
  • jQuery absolutely supports all HTTP request verbs. It's not down to any library whether they are supported or not, it's part of the underlying JS implementation. The premise of your question that they don't is inherently flawed. – Rory McCrossan Jan 21 '20 at 15:34
  • Does this answer your question? [How to send a PUT/DELETE request in jQuery?](https://stackoverflow.com/questions/2153917/how-to-send-a-put-delete-request-in-jquery) – VLAZ Jan 21 '20 at 15:47
  • @VLAZ it does not support them, no. You have to write your own version of the method explicitly, unlike for GET/PUT. – bharal Jan 24 '20 at 11:45
  • "not support" means to me that you *cannot* do a PUT or DELETE. And you *can* - you just have to specify `type: "PUT"` and done. If you're asking why they don't have a shortcut convenience like `$.put` then that's an entirely different question. And I'm not sure we can answer, unless somebody from jQuery drops in to explain it. Likely the answer would just be something like "at first we didn't implement it because we thought it won't be useful often, then afterward nobody asked for it". – VLAZ Jan 24 '20 at 12:03

1 Answers1

2

There can be no better reference than the docs themselves regarding the $.ajax method.

method (default: 'GET')
Type: String
The HTTP method to use for the request (e.g. "POST", "GET", "PUT")

Granted there is no convenient method like $.get and $.post but that is just as they are most commonly used ajax methods. Nothing stopping you going direct to $.ajax for more advanced functionality - that is indeed what it is for.

Jamiec
  • 133,658
  • 13
  • 134
  • 193