6
Rails:发出POST请求时无法验证CSRF令牌的真实性
我想对POST request本地开发人员进行这样的操作: HTTParty.post('http://localhost:3000/fetch_heroku', :body => {:type => 'product'},) 但是,它会从服务器控制台报告 Started POST "/fetch_heroku" for 127.0.0.1 at 2016-02-03 23:33:39 +0800 ActiveRecord::SchemaMigration Load (0.0ms) SELECT "schema_migrations".* FROM "schema_migrations" Processing by AdminController#fetch_heroku as */* Parameters: {"type"=>"product"} Can't verify CSRF token authenticity Completed 422 Unprocessable Entity in 1ms 这是我的控制器和路由设置,非常简单。 def fetch_heroku if params[:type] == 'product' …