Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8004357
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T16:53:59+00:00 2026-06-04T16:53:59+00:00

I am trying to do ajax delete with jquery but getting http error 400.

  • 0

I am trying to do ajax delete with jquery but getting http error 400.
I was searching and I’ve seen that there is some problems with delete method in jquery.

Here’s my js, controller(spring 3) and request from Chrome.

If you now what is the mistake please tell, or give some links.

$.ajax({  
                url: 'additions/cancelUpload',  
                type: 'DELETE',  
                data: {filename : ui.draggable.get(0).file.name},  
                success: function (res) {  
                    alert(res);
                }  
            }); 

execution does not passed here:

@RequestMapping(value = "cancelUpload", produces="text/html")
    @ResponseBody
    public String cancelUpload(@RequestParam("filename")String filename, HttpSession session ){ 
... 
} 

request:

Request URL:http://localhost:8080/WebStore/additions/cancelUpload
Request Method:DELETE
Status Code:400 Bad Request
Request Headersview source
Accept:*/*
Accept-Charset:windows-1251,utf-8;q=0.7,*;q=0.3
Accept-Encoding:gzip,deflate,sdch
Accept-Language:uk-UA,uk;q=0.8,ru;q=0.6,en-US;q=0.4,en;q=0.2
Connection:keep-alive
Content-Length:17
Content-Type:application/x-www-form-urlencoded
Cookie:JSESSIONID=A7DF5CB262C460961BC7B5C7DCB23052
Host:localhost:8080
Origin:http://localhost:8080
Referer:http://localhost:8080/WebStore/items?form
User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.112 Safari/535.1
1X-Requested-With:XMLHttpRequest

Form Dataview URL encoded
filename:6648.jpg

Response Headers

Connection:close
Content-Length:1043
Content-Type:text/html;charset=utf-8
Date:Sat, 26 May 2012 10:03:58 GMT
Server:Apache-Coyote/1.1
X-TraceId:4fc0a8f8-46
X-TraceUrl:/insight/services/traces/4fc0a8f8-46?type=json
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T16:54:01+00:00Added an answer on June 4, 2026 at 4:54 pm

    I manage to recive request as DELETE

     @RequestMapping(value = "cancelUpload", produces="text/html" method = RequestMethod.DELETE)
    

    but do this with

    $.ajax({  
                url: 'additions/cancelUpload',  
                type: 'POST',  
                data: {filename : ui.draggable.get(0).file.name, _method: 'DELETE'},  
                success: function (res) {  
                    alert(res);
                }  
            }); 
    

    you can read about _method: ‘DELETE’ parameter of post request in http://blog.springsource.org/2009/03/08/rest-in-spring-3-mvc/

    IF SOME BODY NOW HOW TO SEND REALLY DELETE AJAX REQUEST. PLEASE TELL ME

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to submit a simple jQuery ajax call but using the DELETE method
I am trying to use Jquery.ajax() with PUT and DELETE methods and sending some
I have created an IHttpAsyncHandler that I'm trying to call using AJAX, with jQuery.
I'm using jQuery UI Tabs with Ajax and I am getting an error: Failed
I'm trying to delete a file with jQuery's $.ajax and php. I have the
I'm trying to delete a li item using jquery, but its not working. Here's
I am trying to learn how to post some data using $.ajax through jquery
Asp.Net 3.5 / WebForms (no ajax) I am trying to update a delete confirm
I am trying to AJAX some content into the #BlogContainer div and cannot seem
Currently trying at add ajax to a site, after much reading I discovered that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.