Skip to content

Instantly share code, notes, and snippets.

@igor-alexandrov
Created June 12, 2020 09:25
Show Gist options
  • Save igor-alexandrov/e97f7680291b736bb5864e7feb3fab34 to your computer and use it in GitHub Desktop.
Save igor-alexandrov/e97f7680291b736bb5864e7feb3fab34 to your computer and use it in GitHub Desktop.
def fetch_using_http(uri)
HTTP::Client.get(uri.to_s) do |response|
if response.status == HTTP::Status::OK
parse_type(response.body_io) # return FastImage::Meta or raises an error
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment