Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
def send_index(index)
uri = URI.parse('http://127.0.0.1:4567/index')
# uri = URI.parse('http://serveit.herokuapp.com/index')
req = Net::HTTP::Post.new(uri.host)
req.body = index
res = Net::HTTP.start(uri.hostname, uri.port) do |http|
http.request(req)
end
puts "Response #{res.code} #{res.message}: #{res.body}"
return
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.