Gem grape 里面的 header 疑问

tsinghan · September 29, 2014 · Last by TsingHan replied at September 30, 2014 · 2075 hits
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 参数是什么意思?

You need to Sign in before reply, if you don't have an account, please Sign up first.