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
5
votes
1 answer

Send an http delete request

I need to how I can send an http delete request, I've implemented the code below - (void) deleteSyncRequestWithURL:(NSString *) url { NSMutableURLRequest *request = [[[NSMutableURLRequest alloc] init] autorelease]; [request setURL:[NSURL…
5
votes
3 answers

REST - HTTP DELETE - semantics - only delete descendants

In our project, a list of all books can be retrieved through REST: GET http://server/api/books/ A specific book can be retrieved as following: GET http://server/api/books/:id/ Deleting a specific book is easy: DELETE…
Appelsien S.
  • 271
  • 1
  • 2
  • 5
5
votes
2 answers

How to write a test for 'delete' operation in Django rest framework

I'm writing tests for my Django Rest Framework API. I'm stuck on testing 'delete'. My test for 'create' works fine. Here's my test code: import json from django.urls import reverse from rest_framework import status from rest_framework.test import…
Little Brain
  • 2,647
  • 1
  • 30
  • 54
5
votes
1 answer

Can't delete item in Elasticsearch with _delete_by_query

I would like to delete some items in Elasticsearch database according simple condition. I try to do it via Postman app. So I have a POST request to this url localhost:9200/newlocalsearch/_delete_by_query with this json query: { "query": { …
Čamo
  • 3,863
  • 13
  • 62
  • 114
5
votes
1 answer

Why doesn't Django Rest Framework APIRequestFactory support query_params for DELETE method?

In one of my view, I'm passing additional data as query params in APIView delete method. I'm able to fetch the same using the request.query_params in the view. But when I'm trying to test the same with DRF APIRequestFactory, the data is empty.…
user1800722
5
votes
0 answers

PUT and DELETE methods having the body parameters removed

I have a laravel API. For those that don't know, Laravel uses method spoofing to deal with PUT and DELETE methods so it reads a POST call with _method=[PUT|DELETE] as a PUT or DELETE method. We test our API with Postman. In postman I can send true…
Bill Garrison
  • 2,226
  • 3
  • 34
  • 75
5
votes
2 answers

CFHTTP & CloudFlare API: DELETE purge_everything not working

Has anyone else been able to DELETE purge_everything with CFHTTP? I can't seem to get ColdFusion CFHTTP to successfully purge a CloudFlare zone's cache. But I am able to do other things like list zones, etc. So I know I can successfully CFHTTP to…
Jules
  • 1,941
  • 15
  • 18
5
votes
2 answers

HTTP Delete with python requests module

I would like to do a HTTP DELETE with python requests module that follows the API below; https://thingspeak.com/docs/channels#create DELETE https://api.thingspeak.com/channels/4/feeds api_key=XXXXXXXXXXXXXXXX I am using python v2.7 and…
guagay_wk
  • 26,337
  • 54
  • 186
  • 295
5
votes
2 answers

How to set RequestBody for Http Delete method.

I am writing a client code for a server which Delete API. The API specification requires data to be sent. I am using HttpComponents v3.1 library for writing client code. Using the HtpDelete class I could not find a way to add request data to it. Is…
Tushar Tarkas
  • 1,592
  • 13
  • 25
4
votes
1 answer

github v3 API - delete / remove a repo

I would like to programmatically delete a github repo, when setting up a unit test environment for my application. I am already using the v3 API, which seems to be most supported and the path going forward. I am using the following python lines to…
Nay
  • 1,057
  • 10
  • 17
4
votes
3 answers

How to have DeleteMapping in Spring that deletes based on different types of path variables?

I am trying to build a REST application in Spring where I have a requirement to delete resources on the basis of certain path variables. For example, I want to delete resource(s) by id @DeleteMapping("resources/{id}") or by…
Auro
  • 1,578
  • 3
  • 31
  • 62
4
votes
2 answers

PUT and DELETE getting 404 in WCF REST service .net 4 when running in IIS 6.0

I've added the wildcard application mapping for c:\windows\microsoft.net\framework\v4.0.30319\aspnet_isapi.dll and unchecked the "verify that file exist" checkbox. This gives me GET and POST ability but not PUT and DELETE. I have both prohibited and…
Roy
  • 41
  • 3
4
votes
1 answer

How to redirect after a successful DELETE request

I have an HTML form performing a DELETE request (method = POST & hidden X-HTTP-Method-Override = DELETE) When the DELETE request is successful, how do I tell the browser to redirect to another page? Is 303 + header location okay? Currently, the…
Mathieu
  • 5,495
  • 2
  • 31
  • 48
4
votes
2 answers

Rest Api: When to use Post, PUT, PATCH and Delete

I am working on a restful api and I need to update a resource (i.e. a customer detail record with 10 fields). On Add request, I send a Post request with complete record. On update request, I send a PUT request with complete record of 10 fields.…
TAB
  • 1,944
  • 8
  • 28
  • 45
4
votes
3 answers

How to pass body through `httpclient` delete request in Angular5

How to pass body through httpClient in delete request? Please check my code. Is there any idea to pass data through body in delete request. There is no proper source how to call this request in angular 5. let body = removeFile; return…