the*_*Man 13
如果我想要简单的代码,这就是我要做的事情:
require 'open-uri'
str = open('http://example.com')
str.content_type #=> "text/html"
Run Code Online (Sandbox Code Playgroud)
它的最大优点是重定向.
如果您正在检查一堆URL,则可能需要close在找到所需内容后调用句柄.
| 归档时间: |
|
| 查看次数: |
3545 次 |
| 最近记录: |