WARNING: Can't verify CSRF token authenticity in case of API development

后端 未结 2 1878
时光取名叫无心
时光取名叫无心 2020-12-08 00:06

I am right now developing web APIs with Ruby on Rails. When the Rails app receives POST request without any csrf token, the following error message shall ha

2条回答
  •  不思量自难忘°
    2020-12-08 00:53

    You can do this by adding

    skip_before_filter  :verify_authenticity_token
    

    to your controller. This way all incoming requests to the controller skips the :verify_authenticity_token filter.

提交回复
热议问题