Method: DatadogAPIClient::APIClient#json_mime?

Defined in:
lib/datadog_api_client/api_client.rb

#json_mime?(mime) ⇒ Boolean

Check if the given MIME is a JSON MIME. JSON MIME examples:

application/json
application/json; charset=UTF8
APPLICATION/JSON
*/*

Parameters:

  • mime (String)

    MIME

Returns:

  • (Boolean)

    True if the MIME is application/json



270
271
272
# File 'lib/datadog_api_client/api_client.rb', line 270

def json_mime?(mime)
  (mime && mime.downcase.include?('json')) || mime == '*/*'
end