Method: DocuSign_Maestro::ApiClient#select_header_accept

Defined in:
lib/docusign_maestro/client/api_client.rb

#select_header_accept(accepts) ⇒ String

Return Accept header based on an array of accepts provided.

Parameters:

  • accepts (Array)

    array for Accept

Returns:

  • (String)

    the Accept header (e.g. application/json)

[View source]

328
329
330
331
332
333
# File 'lib/docusign_maestro/client/api_client.rb', line 328

def select_header_accept(accepts)
  return nil if accepts.nil? || accepts.empty?
  # use JSON when present, otherwise use all of the provided
  json_accept = accepts.find { |s| json_mime?(s) }
  return json_accept || accepts.join(',')
end