52liming

ajax和 Http Status

之前一直奇怪ajax发送请求后success 和 error 分界的状态码是多少, 主要很多将ajax的教程也没有提到,
例如, 我用ResponseEntity<Map>(map, HttpStatus.INTERNAL_SERVER_ERROR); (500)来响应, ajax会用error来接收, 然后在论坛看到有大佬说到了Ajax源码中有指明:

isSuccess = status >= 200 && status < 300 || status === 304;

Spring 中的Enum HttpStatus

Http 状态码

52liming.com

分类:

技术点:

相关文章:

  • 2021-09-07
  • 2022-12-23
  • 2022-12-23
  • 2022-01-05
  • 2022-01-05
  • 2022-12-23
  • 2022-01-05
  • 2021-09-07
猜你喜欢
  • 2021-11-05
  • 2022-02-01
  • 2021-09-07
  • 2022-12-23
  • 2022-01-05
  • 2022-12-23
  • 2021-11-05
相关资源
相似解决方案