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
2
votes
2 answers

405 Method Not Allowed for DELETE

I'm getting a '405 Method Not Allowed' when I attempt for a DELETE without passing the resource Id which needs to be deleted.Here is my URL http://localhost:8080/api/vendors/delete/1234/ where ideally I should have given the ID at the end of the…
Akash Yellappa
  • 2,126
  • 28
  • 21
2
votes
1 answer

request.getParameter doesn't work for PUT or DELETE

If request is an HTTPServletRequest why can I use request.getParameter to get the body for a POST request, but not for a PUT or DELETE request?
winhowes
  • 7,845
  • 5
  • 28
  • 39
2
votes
2 answers

DELETE API not working

I want to simply delete a user from the database. using MEAN Stack, mlab. This is my delete API router.delete('/delete/:id', function (req, res) { User.findByIdAndRemove(req.params.id, function (err, user) { if (err) { return…
Jibran Yousuf
  • 77
  • 1
  • 10
2
votes
2 answers

spoofing request method in laravel action() helper method?

In a Laravel 5.5 project, I have a student controller with destory method. public function destroy(Student $student) { //destroy $student and redirect } I have the route for the controller as follows Route::delete('/student/{id}',…
Shobi
  • 10,374
  • 6
  • 46
  • 82
2
votes
3 answers

DELETE verb not working in iis 10

DELETE method is showing the below error in IIS 10 No 'Access-Control-Allow-Origin' header is present on the requested resource. All other methods like POST and GET are working fine. Also DELETE was working fine in iis express at the time of…
Beingnin
  • 2,288
  • 1
  • 21
  • 37
2
votes
1 answer

CORS - Delete and Put are not working,

I did all the setting, Standerd web api config Added all origins AllowAnyMethod,AllowAnyHeader,SupportsCredentials,AllowAnyOrigin set to true From IIS 7.5 delegation , set values to Read/Write but still not able to make Delete and Put…
Amol Hegana
  • 147
  • 1
  • 10
2
votes
1 answer

Send DELETE request to an API endpoint using Nestful Sinatra

I want to send a DELETE request to an external API endpoint in a controller of my Sinatra application using nestful gem. I want to delete an event by sending a DELETE request to an endpoint of TeamSnap API. I have defined the following route in…
Faisal Raza
  • 1,337
  • 1
  • 10
  • 16
2
votes
1 answer

Fetch delete request method using react redux is not deleting

i'm trying to use fetch delete request method to delete item in my localhost server using react redux method to call deleteItem(e) { e.preventDefault(); const id = this.props.id; this.props.deleteSet(id); } Dispatching the…
Al-ameen Ak
  • 23
  • 1
  • 5
2
votes
2 answers

404 Rejected-By-UrlScan Delete Request

On my Web API I have a few [HttpGet] functions that work perfectly, but the one that is [HttpDelete] (on the same Controller) doesn't work, it returns 404 error. [Authorize] [RoutePrefix("Users")] public class UsersController : ApiController { …
user3378165
  • 6,546
  • 17
  • 62
  • 101
2
votes
1 answer

unable to get PUT and DELETE request data in phalcon controller

I have my project in phalcon framework version 2.1.0r on nginx with PHP 7.0.19. In my routes.php file the routes are configured like this : $usersCollection->delete('/{name}', 'delete'); $usersCollection->put('/{name}', 'update'); In my controller…
Mainak
  • 469
  • 3
  • 9
  • 33
2
votes
2 answers

DELETE Request in Python "requests" module not working with body

I have been using this function to handle http requests with no problems: def do_request(self, method, url, **kwargs): params = kwargs.get('params', None) headers = kwargs.get('headers', None) payload = kwargs.get('data', None) …
user3192199
  • 31
  • 1
  • 5
2
votes
0 answers

Which Java exception should I throw when I cannot delete a resource because it's being used?

I have a RESTful web application with an endpoint that allows the user to delete a particular resource by providing its id: DELETE /rules/{id} In some cases, one rule may reference another rule. If Rule A references Rule B, and a user attempts to…
Matt
  • 23,363
  • 39
  • 111
  • 152
2
votes
0 answers

CGI http delete parameters?

In my App I cant use Frameworks like Mojo or Dancer or so on. I have to check for the request method by CGI->new()->request_method And I know I can get the Parameters from POST or PUT by CGI->new()->param('POSTDATA') # OR 'PUTDATA' I have to this…
user7445564
2
votes
0 answers

AngularJS $http.delete and $http.put don't work in real life

I have made a simple CRUD application with AngularJS which retrieves the data with a simple RESTful API (https://github.com/mevdschee/php-crud-api). Testing on localhost gives no error at all. All working as expected. Testing on a remote server:…
Jojoseph
  • 123
  • 4
  • 13
2
votes
2 answers

Delete rest with parameters

I need to write this REST request in java using Httpdelete or any other library. curl -X DELETE -d '{"ruleid":"1" }' http://192.168.1.1:8080/wm/acl/rules/json I couldn't find a way to parse the Json data ! Thanks for your help !
Striker
  • 43
  • 1
  • 6