I'm running postman to send requests to my rails server. I am facing authenticity token issues when sending POST requests to create new objects. I need to be able to send all requests across the server and add the necessary authentications to a Postman environment.
Asked
Active
Viewed 257 times
0
-
Does my answer help you ? – adesurirey Jun 21 '19 at 10:53
1 Answers
0
If you're creating an API and want to accept requests from other domains you'll need to disable this security filter.
To do it add this to your controller :
skip_before_action :verify_authenticity_token, only: :your_post_action
You can disable it only for json requests, see this answer: https://stackoverflow.com/a/22715175/8352929

adesurirey
- 2,549
- 2
- 16
- 36