Created
June 12, 2020 09:25
-
-
Save igor-alexandrov/e97f7680291b736bb5864e7feb3fab34 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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