Created
April 4, 2018 02:35
-
-
Save picatz/791da76b2611d180510619a8c76f1871 to your computer and use it in GitHub Desktop.
what
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'pry' | |
require 'async/http/client' | |
require 'async/http/url_endpoint' | |
require 'async/io/ssl_socket' | |
require 'async/reactor' | |
url = "https://cloudflare-dns.com" | |
query = { name: "microsoft.com", type: "MX", ct: "application/dns-json" } | |
headers = {'Content-Type': 'application/json'} | |
binding.pry | |
#endpoint = Async::HTTP::URLEndpoint.parse(url) | |
client = Async::HTTP::Client.new(endpoint) | |
binding.pry | |
Async::Reactor.run do |task| | |
response = client.get("/dns-query?name=microsoft.com?type=MX?ct=application/dns-json", { headers: headers }) | |
binding.pry | |
puts response.body | |
end | |
binding.pry |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment