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

404 errors for PUT and DELETE requests on deployed WCF RESTful Service

I have deployed an MVC3 and WCF web service as a single application. Both work as expected. GET and POST requests work perfectly, but the PUT and DELETE requests return 404 errors. These work fine locally. Initially it was requesting a…
2
votes
1 answer

DELETE with Jersey REST webservice client always throws 404

I have implemented a generic REST webservice client. Everything is working correctly except the delete request. It always returns a "404 -> NOT FOUND" error, but when using other tools (firefox poster & curl), I can execute the delete request, so…
ToHe
  • 147
  • 3
  • 13
2
votes
2 answers

Next.js 13 DELETE request 'SyntaxError: Unexpected end of JSON input'

I have a web app using Next 13 with a route.ts file under the api folder that currently contains 2 different methods POST and DELETE. Both methods receive the request successfully but when trying to JSON parse the body of the request, it works for…
IdoBa
  • 63
  • 6
2
votes
4 answers

HttpDelete request with JSON payload in Android

I need to call a web service to delete data, and I need to do it using HttpDelete. The service takes a JSON object as parameter. I have done HttpPost before, using SetEntity, but this is not available with HttpDelete. It's a call like…
Soeren
  • 1,023
  • 4
  • 22
  • 41
2
votes
0 answers

fetch delete request returns: Unhandled Rejection (TypeError): Failed to execute 'fetch' on 'Window': 'DELETE' is unsupported in no-cors mode

i have a lamda delete request on aws serverless in there ive wrote in serverless.yaml all the cors needed : cors: STILL im getting errors that DELETE' is unsupported in no-cors mode. did anyone had the same problem? Thank you …
2
votes
1 answer

DELETE http://localhost:3000/people/[object%20Object] 404 (Not Found)

So I have been trying to delete a person from my table with this function: const deletePerson = async (id) => { await fetch(`http://localhost:3000/people/${id}`, { method: "DELETE", headers: { "Content-type":…
Arda Ravel
  • 68
  • 2
  • 7
2
votes
0 answers

Use request body for HTTP-DELETE method (ASP.NET Core WebAPI)

According to the RFC7231 standard: A payload within a DELETE request message has no defined semantics; sending a payload body on a DELETE request might cause some existing implementations to reject the request. In my example I am using ASP.NET…
mi_hoe
  • 21
  • 2
2
votes
2 answers

Ajax delete request returns 200 but fires error

I am trying to create a simple API for my project. I am sending a DELETE request using jquery Ajax. The Delete request gets sent, does what it is supposed to do(deletes an entry from the database), return a status 200, but fires an error event. I…
Leon Kardaš
  • 101
  • 8
2
votes
1 answer

Flutter: How am I supposed to access the response body in this Delete request?

I'm using this piece of code to make a delete request with a body : Future deleteAcc(data) async { Map headers = { "Content-Type": "application/json", 'Authorization': '$token' }; print('In Provider'); …
Shero_Ha
  • 41
  • 2
  • 4
2
votes
1 answer

How to do a class based delete view that allows DELETE method in django 3.1?

In Django 3.1, the typical DeleteView accepts GET and POST. See https://docs.djangoproject.com/en/3.1/ref/class-based-views/generic-editing/#deleteview and I reproduce below: A view that displays a confirmation page and deletes an existing object.…
Kim Stacks
  • 10,202
  • 35
  • 151
  • 282
2
votes
2 answers

Web API HttpDelete - how to call delete API method and send a model in [FromBody]

I am trying to call a HttpDelete restful web API method, by sending the parameters in the url. Call is successful. Example string url = path + "deletemethodName?Id=" + Convert.ToInt32(idpamameter) + "&name=" + nameParameter; using…
user2294434
  • 123
  • 4
  • 16
2
votes
1 answer

Microsoft Graph API, DELETE request response Error code 403 ""Access is denied. Check credentials and try again."

I am working on a Microsoft Graph API app where i want to delete email messages from the inbox. I do that by first getting the emails, putting the id from each email in an array and for each id in that array making a delete request to remove it from…
2
votes
0 answers

how to create httpclient for delete request with application/x-www-form-urlencoded

i am creating this request but it is working as get method not like delete `public static void main(String[] args) { OkHttpClient client = new OkHttpClient(); try { Request request = new Request.Builder() …
Ashish
  • 31
  • 2
2
votes
1 answer

Editing/Deleting Calendar Events without notifications

We have an Outlook365 integration, which posts events to calendars from an external system via the Graph V1.0 API. In November, a little bug has snuck about 2,000 events into various peoples calendars over the coming 12 months. We have managed to…
2
votes
1 answer

Body of delete request is empty in my rest api endpoint

I seem to get empty body content of a Go http.Request if the method is DELETE. But if I change the method to POST, then the body content gives me the content I expect. The relevant code from my golang looks like this: import( …
John
  • 32,403
  • 80
  • 251
  • 422