Gem grape 里面的 header 疑问

tsinghan · 2014年09月29日 · 最后由 TsingHan 回复于 2014年09月30日 · 2075 次阅读
version 'v1', using: :header, vendor: 'twitter'

grape 里面配置 version 有 header 方式 但是后面的 vendor 这个参数是什么意思? 还有大家平时写 api 时 version 的方式一般用的是哪种方式?path or header or ?

version 'v1', using: :header, vendor: 'twitter'

Using this versioning strategy, clients should pass the desired version in the HTTP Accept head. curl -H Accept:application/vnd.twitter-v1+json http://localhost:9292/statuses/public_timeline

默认是 :path 也可以参考 ruby-china 的 API https://github.com/ruby-china/ruby-china/blob/master/app/grape/api_v2.rb

#1 楼 @congteng 我想问的是 vendor 参数是什么意思?

需要 登录 后方可回复, 如果你还没有账号请 注册新账号