Questions tagged [http-delete]

DELETE is an HTTP request method used to delete a specified resource on server side.

DELETE is an HTTP method which requests that the origin server delete the resource identified by the request URL. This method may be overridden by human intervention (or other means) on the origin server. The client cannot be guaranteed that the operation has been carried out, even if the status code returned from the origin server indicates that the action has been completed successfully. However, the server should not indicate success unless, at the time the response is given, it intends to delete the resource or move it to an inaccessible location.

A successful response should be 200 (OK) if the response includes a response body describing the status, 202 (Accepted) if the action has not yet been enacted, or 204 (No Content) if the action has been enacted but the response does not include a response body.

If the request passes through a cache and the URL identifies one or more currently cached entities, those entries should be treated as stale. Responses to this method are not cacheable.

References- apache.org, w3.org

536 questions
26
votes
1 answer

RESTful HTTP DELETE method in .NET

I am new to web services. I am dealing with testing APIs in my project. In the previous version the company used GET and POST methods but not PUT and DELETE methods. For the HTTP DELETE method, I have browsed various websites where I found the…
VIBA
  • 263
  • 1
  • 3
  • 4
25
votes
6 answers

How can I send a http delete request from browser?

Is there a way to send a DELETE request from a website, using xmlhttprequest or something similar?
Kalvaresin
  • 251
  • 1
  • 3
  • 3
23
votes
3 answers

How to delete SOLR indexed data by query with curl?

I have a SOLR schema.xml like this: I want to delete "blue" and "stationwagon" tagged records from SOLR…
Guray Celik
  • 1,281
  • 1
  • 14
  • 13
22
votes
4 answers

.NET Web API CORS PreFlight Request

I have some trouble make PUT and DELETE CORS request to Web API on other domain. I've coded API by tutorial http://www.asp.net/web-api/overview/security/enabling-cross-origin-requests-in-web-api#create-webapi-project. GET and POST Requests works…
Milan Gatyás
  • 2,509
  • 1
  • 17
  • 23
22
votes
3 answers

Is it okay to use an HTTP DELETE to deactivate a record?

I'm building a RESTful API command to deactivate a user record. Is it kosher to use DELETE to do this or should this be a PUT, since the record is being updated to "deactivated" status? Or is it just a matter of taste?
abeger
  • 6,766
  • 7
  • 41
  • 58
22
votes
1 answer

Rails Redirect After Delete Using DELETE Instead of GET

I have a route I am issuing a DELETE on: user_authorization_path(@user, authorization) It hits my controller fine, the controller deletes the resource, and then issues a redirect: redirect_to edit_user_path(params[:user_id]) The result of this is…
SingleShot
  • 18,821
  • 13
  • 71
  • 101
21
votes
5 answers

Spring - 405 Http method DELETE is not supported by this URL

Well I have a strange problem with executing a "DELETE" HTTP request in Spring. I have a controller method which I have mapped a DELETE request to: @RequestMapping(value = "/{authorizationUrl}",method=DELETE) public void…
Sasanka Panguluri
  • 3,058
  • 4
  • 32
  • 54
21
votes
2 answers

Using PUT and DELETE methods in Spring MVC

I'm trying to use RequestMethod.PUT and RequestMethod.DELETE in Spring MVC controller (version 3.0.2). There are three methods mapped with a URL in the Spring controller class as follows (PUT, GET and POST respectively, for the demonstration purpose…
Tiny
  • 27,221
  • 105
  • 339
  • 599
20
votes
5 answers

Sending a DELETE request from Sinatra

I am trying to develop a RESTful Sinatra application. Now, I know how to respond to a delete request with something like delete '/user/:id' do |id| #do something in the model end What I am interested in is how do I get to execute that method. I…
sebastiangeiger
  • 3,386
  • 7
  • 29
  • 37
18
votes
3 answers

ExpressJS - res.redirect after DELETE request

I have been searching all over for how to do this - I am trying to redirect after a DELETE request is made - here is the code I am using WITHOUT THE REDIRECT: exports.remove = function(req, res) { var postId = req.params.id; Post.remove({ _id:…
ewizard
  • 2,801
  • 4
  • 52
  • 110
17
votes
1 answer

body is empty when parsing DELETE request with express and body-parser

I'm using expressjs and the body-parser middleware. This is how I initiate it: app.use(bodyParser.urlencoded({ extended: true })); app.use(bodyParser.json()); From the client I'm sending a DELETE request and when I try to pick it up from the server…
Tom Klino
  • 2,358
  • 5
  • 35
  • 60
14
votes
1 answer

Retrofit 2.0 how to delete?

I am using retrofit 2.0 and I am implementing a delete feature in my Android app, however, I cannot make it successfully, can someone give me a suggestion? I tried both: @DELETE("books/{id}") void deleteBook(@Path("id") int…
xiaoyaoworm
  • 1,052
  • 4
  • 13
  • 32
13
votes
5 answers

How to make Apache Tomcat accept DELETE method

I'm working on a project of RESTful web services, i'm using Apache Tomcat and JAX-RS. I want to accept DELETE requests from client but whenever i send a DELETE request from Advanced REST client Chrome plugin it gives response code 403 Forbidden. So…
VishalDevgire
  • 4,232
  • 10
  • 33
  • 59
12
votes
2 answers

Retrofit throwing IllegalArgumentException exception for asynchronous FormUrlEncoded DELETE call

I'm trying to make an asynchronous POST and DELETE which is form url encoded using Retrofit in Android 4.4 Here is my client - @FormUrlEncoded @POST(INetwork.API_BASE_PREFIX + "/memberships.json") void join(@Field("id") String id, Callback
Rickster
  • 1,393
  • 3
  • 13
  • 19
12
votes
4 answers

IIS7.5 Gives 500 Internal Server Error when trying to use DELETE verb

I am trying to issue a DELETE to an IIS7.5 resource: DELETE http://198.252.206.16:48251/Test/foo.ashx HTTP/1.1 Accept: */* Accept-Language: en-us Accept-Encoding: gzip, deflate User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64;…
Ian Boyd
  • 246,734
  • 253
  • 869
  • 1,219
1
2
3
35 36