Is it somehow possible to check if a file exists, without actually downloading it?
I have this large (~ 40mb) file, for example:
http://mirrors.sohu.com/mysql/MySQL-6.0/MySQL-6.0.11-0.glibc23.src.rpm
This is not strictly related to ruby, but it would be nice if the sender could set the content length.
RestClient.get "http://mirrors.sohu.com/mysql/MySQL-6.0/MySQL-6.0.11-0.glibc23.src.rpm",
headers: {"Content-Length" => 100}
Try RestClient.head
. (See http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.4.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With