Turning off authenticity token in Rails 2 for web services?

后端 未结 3 1694
旧时难觅i
旧时难觅i 2021-01-12 04:39

Instead of just filling out the form in HTML it should also be possible to just send a post request containing the params.. Is it possible to turn off the authenticity token

3条回答
  •  青春惊慌失措
    2021-01-12 05:30

    I know there is a way to turn it off for a controller or an action. Not sure about the content type. Wouldn't it be easier to just add the authenticity token to every json request? There are quite few articles around the web how to do it (for example here and here).

提交回复
热议问题