#!/usr/bin/ruby

# Http

## Open URI

require 'open-uri'

URI.open("https://www.naver.com") {|resp|
  resp.each_line {|line|
    p line
  }
}

URI.open("https://www.naver.com", "User-Agent"=>"Ruby", "Authentication"=>"Bearer abcdef") {|resp|
  resp.each_line {|line|
    p line
  }
}

uri = URI.parse("https://www.naver.com") #
uri.open {|resp|
  # ...
}




END{


  # https://ruby-doc.org/3.3.0/stdlibs/net/Net/HTTP.html
  # https://ruby-doc.org/3.3.0/stdlibs/net/http/Net/HTTP.html
  # https://ruby-doc.org/3.3.0/stdlibs/uri/URI.html

  # https://ruby-doc.org/3.3.0/stdlibs/open-uri/OpenURI.html

}
