How does the springboot restful interface accept put and delete requests from the front end


Recently, someone in the project team asked me, “why can’t springboot accept put and delete requests submitted by the front end?”
Therefore, with this article, this article mainly solves two problems:

  • JS can only submit get and post requests? How to submit a put delete request?
  • How to connect put and delete requests submitted by the front end to the server end?

Problem 1 solution:
Send a post request in Ajax with_ Method parameter_ The method value is put or delete


Problem 2 solution:
Configure hiddenhttpmethodfilter

public class HttpRequestConfig {
    public HiddenHttpMethodFilter hiddenHttpMethodFilter() {
        HiddenHttpMethodFilter hiddenHttpMethodFilter = new HiddenHttpMethodFilter();
        return hiddenHttpMethodFilter;

Recommended Today

SQL exercise 20 – Modeling & Reporting

This blog is used to review and sort out the common topic modeling architecture, analysis oriented architecture and integration topic reports in data warehouse. I have uploaded these reports to GitHub. If you are interested, you can have a lookAddress: recorded a relatively complete development process in my hexo blog deployed on GitHub. You can […]