-
Notifications
You must be signed in to change notification settings - Fork 27.4k
Move delete
to be method with body.
#8567
Comments
Well, if specs don't define precisely semantics here I guess we shouldn't be preventing people from sending DELETE requests with body. I recall several other issues being opened for this. |
Actually the same is stated about GET. http://tools.ietf.org/html/rfc7231#section-4.3.1 Sometimes, when I want to perform a query and need to send a bunch of data, I end up writing a POST method for the ability to send a payload. |
While future behavior is being discussed, at least the documentation should reflect the current behavior. I lost a bunch of time and eventually had to debug into angular code to figure out what was going on. Not a straight forward task with digest/callbacks. |
@rcollette The |
I don't see anything in fetch or xhr that would forbid or ignore the request body for |
@caitp last time I looked at various specs (mostly HTTP) it wasn't clear if it is at allowed on HTTP level to have DELETE with body. It seems like some servers ignore body even if sent, some other process it. But I agree that we should try to see if things are not exploding on XHR-level in all browsers and if not, we could move this method to the set of ones with allowed body. Unless someone finds a spec that forbids this. |
yes, and it's arguably not a best-practice to include a body in DELETE requests because some backends discard them --- but I don't believe there's anything in the RFCs or the WHATWG specs for the clientside that enforce any of this |
hey body, I use $reosure to delete, it doesn't send a body ,it put params in url. is it possible to change, and how? |
Also I think it is reasonable to put the body in $resource detele request. People can choose the way they put the params. |
For reasons explained here (and in other threads) I believe it is better to consider While we might revisit this decision at a later point, atm treating Also note that it is already possible to send a payload with $http({
method: 'delete',
url: '/some/url',
headers: {'Content-Type': 'application/json'},
data: {some: 'payload'}
});
// or
$http.delete('/some/url', {
headers: {'Content-Type': 'application/json'},
data: {some: 'payload'}
}); There is also some discussion in #3207 with more details. |
@gkalpak Thanks for you answering,I really appreciate that, that helps me a lot |
http://tools.ietf.org/html/rfc7231
This states:
So shouldn't
delete
be removed from:And added to:
(discussion doesn't include how a server may or may not handle this type of request)
This is in regards to:
http://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol
The text was updated successfully, but these errors were encountered: