code: def _get_acceptable_response_type():
      
      if ('Accept' not in request.headers or request.headers['Accept'] in
              ALL_CONTENT_TYPES):
          return JSON
      acceptable_content_types = set(
          request.headers['ACCEPT'].strip().split(','))
      if acceptable_content_types & HTML_CONTENT_TYPES:
          return HTML
      elif acceptable_content_types & JSON_CONTENT_TYPES:
          return JSON
      else:
          # HTTP 406 Not Acceptable
          raise InvalidAPIUsage(406)
docs: Return the mimetype for this request.