mirror of
https://github.com/HoneyryderChuck/httpx.git
synced 2025-10-05 00:02:38 -04:00
15 lines
414 B
Ruby
15 lines
414 B
Ruby
require "httpx"
|
|
|
|
URLS = %w[https://nghttp2.org/httpbin/get] * 1
|
|
|
|
HTTPX.wrap do |client|
|
|
res1 = client.get("https://nghttp2.org/httpbin/get", resolver_class: :native)
|
|
res2 = client.get("https://www.google.com", resolver_class: :https)
|
|
res3 = client.get("https://news.ycombinator.com/", resolver_class: :native)
|
|
|
|
puts "res1: #{res1.status}"
|
|
puts "res2: #{res2.status}"
|
|
puts "res3: #{res3.status}"
|
|
end
|
|
|