code: def find_response_format(allowed_response_formats):
      
      # allowed formats default to [] before this
      if not allowed_response_formats:
          allowed_response_formats = [ResponseFormats.JSON]
  
      content_type = request.headers.get("Accept")
      if content_type is None:
          # Nothing specified, default to endpoint definition
          if allowed_response_formats:
              return allowed_response_formats[0]
          # Finally, default to JSON
          return ResponseFormats.JSON
  
      for response_format in ResponseFormats.prioritized():
          if response_format not in allowed_response_formats:
              continue
          if response_format.matches(content_type):
              return response_format
  
      # fallback for previous behavior
      return ResponseFormats.JSON
docs: Basic content negotiation logic.
  
      If the 'Accept' header doesn't exactly match a format we can handle, we return JSON