Started PUT "/products/597074f958efe52639ad261a" for 127.0.0.1 at 2017-07-29 00:17:11 +0800 Processing by ProductsController#update as HTML Parameters: {"title"=>"abc", "desc"=>"hehe", "id"=>"597074f958efe52639ad261a", "product"=>{"title"=>"abc", "desc"=>"hehe"}} Can't verify CSRF token authenticity. Completed 422 Unprocessable Entity in 1ms
ActionController::InvalidAuthenticityToken (ActionController::InvalidAuthenticityToken):
我用 react 写了个例子。 get 信息的时候没有问题,但是 put 的时候,就 422 了。
我尝试了添加:axios.defaults.headers.common['Authorization'] = 'L2yn79biL79xYPVV7N3997FEyLUeN9Av7DfweSocco4ircVzTs+qli8tcVgd8Hx+Y2CNRgFAPrMLAFrOxoCRsg=='; 在代码中,依然无效。 请问应该怎么解决 token 的问题?