0

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.

A.A. F
  • 349
  • 5
  • 16

1 Answers1

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