ohh*_*hho 7 ruby-on-rails devise ruby-on-rails-3
目前,设计配置为通过URL接受令牌认证,并且curl运行良好
curl 'http://localhost/index.json?auth_token=TOKENVALUE'
Run Code Online (Sandbox Code Playgroud)
现在我想通过通过HTTP标头,而不是URL的TOKENVALUE,我该怎么配置设计获得从TOKENVALUE 或者 HTTP标头或 URL?这样上面和下面的curl请求都可以工作:
curl 'http://localhost/index.json' -H 'Authorization: Token token="TOKENVALUE"'
Run Code Online (Sandbox Code Playgroud)
如此railscast中所示.