Method: JSONRPC2::HTTPUtils.which
- Defined in:
- lib/jsonrpc2/accept.rb
.which(http_client_accepts, options) ⇒ Object
Selects the clients preferred media/mime type based on Accept header
54 55 56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/jsonrpc2/accept.rb', line 54 def which http_client_accepts, return nil unless http_client_accepts parse_accept(http_client_accepts, true).each do |preference, types| types.each do |type| .each do |option| return option if type.match(option) end end end nil end |