Get the file size of a URL in Ruby

85 Views Asked by At

Here is a link: "https://www.reddit.com".

While requiring "open-uri" in a ruby file the same link responds with 2 different file sizes when using these 2 methods:

p URI.open("https://www.reddit.com").size

p open("https://www.reddit.com").size

What is the explanation for this?

0

There are 0 best solutions below