How to handle ajax 201

后端 未结 5 1079
说谎
说谎 2020-12-31 09:16

When making a ajax call see example below success does gets a 201 status retuned. How do you handle these better i.e. 200, 201 within the succe

5条回答
  •  余生分开走
    2020-12-31 09:57

    Instead of

    ResponseEntity responseEntity = new ResponseEntity<>(HttpStatus.CREATED);
    

    I used

    ResponseEntity responseEntity = new ResponseEntity<>(detailVO, HttpStatus.CREATED);
    

    Where detailVO is my object to rutrun in case of success. Then in browser I got response in success function.

提交回复
热议问题