generate functionWed, 01 Mar 2023

get content_type type from url downloded by open-uri

require 'open-uri' def get_content_type(url) uri = open(url) return uri.content_type end get_content_type('https://www.google.com.au/logos/doodles/')

Questions about programming?Chat with your personal AI assistant