How do I download a file over HTTP using Ruby?

后端 未结 5 1031
南笙
南笙 2021-02-07 04:12

How do I download a file over HTTP using Ruby?

5条回答
  •  情深已故
    2021-02-07 04:32

    You can use open-uri, which is a one liner

    require 'open-uri'
    
    content = open('http://example.com').read
    

提交回复
热议问题