我无法使用 https 获取任何东西。
我无法获取类似的东西:
curl -k https://graph.facebook.com
或者
uri = URI('https://graph.facebook.com/davidarturo')
Net::HTTP.get(uri)
我得到:
error: EOFError: end of file reached
httparty 和 https 也没有运气
我无法使用 https 获取任何东西。
我无法获取类似的东西:
curl -k https://graph.facebook.com
或者
uri = URI('https://graph.facebook.com/davidarturo')
Net::HTTP.get(uri)
我得到:
error: EOFError: end of file reached
httparty 和 https 也没有运气
net/http
当您使用“https”协议时,您必须在使用库的情况下明确告知:
require 'net/http'
uri = URI('https://graph.facebook.com/davidarturo')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true if uri.scheme == 'https'
http.start do |h|
response = h.request Net::HTTP::Get.new(uri.request_uri)
puts response.body if Net::HTTPSuccess
end