Springboot2.0解決PUT方法跨域問題

使用@CrossOrigin實現跨域訪問,默認只支持簡單方法:GET,POST。需要支持PUT方法,需要在@CrossOrigin中指定參數。

@CrossOrigin(methods = {RequestMethod.GET, RequestMethod.POST, RequestMethod.PUT, RequestMethod.DELETE})

引用

  1. https://www.cnblogs.com/anxminise/p/9808279.html
  2. https://developer.mozilla.org/zh-CN/docs/Web/HTTP/Access_control_CORS
  3. https://zhuanlan.zhihu.com/p/66789473
  4. https://blog.csdn.net/f641385712/article/details/101170214
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章