开发者

What is returned by Open::URI.open?

开发者 https://www.devze.com 2023-02-09 16:42 出处:网络
I cannot tell from the rdoc for Open::URI what is returned when I do: result = open(url) The URL returns XML, but how do I see/parse the XML?开发者_Go百科open returns an IO object.You can do someth

I cannot tell from the rdoc for Open::URI what is returned when I do:

result = open(url)

The URL returns XML, but how do I see/parse the XML?开发者_Go百科


open returns an IO object. You can do something like:

xml = open(url).read

Note you can always determine what something is by asking for its class:

open(url).class  # => Tempfile
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号