Method: MoneyKit::ApiClient#select_header_content_type
- Defined in:
- lib/moneykit/api_client.rb
#select_header_content_type(content_types) ⇒ String
Return Content-Type header based on an array of content types provided.
370 371 372 373 374 375 376 377 |
# File 'lib/moneykit/api_client.rb', line 370 def select_header_content_type(content_types) # return nil by default return if content_types.nil? || content_types.empty? # use JSON when present, otherwise use the first one json_content_type = content_types.find { |s| json_mime?(s) } json_content_type || content_types.first end |