Skip to content

Instantly share code, notes, and snippets.

@evmorov
Created June 28, 2016 20:34
Show Gist options
  • Save evmorov/caafab16ace3fd9093b26aee24b71ee3 to your computer and use it in GitHub Desktop.
Save evmorov/caafab16ace3fd9093b26aee24b71ee3 to your computer and use it in GitHub Desktop.
require 'net/http'
url = URI.parse('http://localhost:4567/pizza')
req = Net::HTTP::Get.new(url.to_s)
res = Net::HTTP.start(url.host, url.port) { |http| http.request(req) }
body = res.body
abort body if body != 'OK'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment