I’ve got an HTTP In node working fine if I initiate the HTTP request with a browser, but my real need is to initiate the HTTP GET programmatically with Ruby. If I run my Ruby code once, it works, but then it doesn’t work for all subsequent requests … I’m not expecting anyone here to know what the problem is but I am seeking advice on figuring out how to trace it down. I don’t know any troubleshooting techniques for the imp.
For grins, I include my Ruby code below, perhaps a Rubyist will know the problem. Thanks!
require 'net/http' require 'net/https' require 'uri' url = URI.parse 'https://api.electricimp.com/v1/d47248a50139f9fc/30e9af9345ad2282?value=0.9' http = Net::HTTP.new(url.host, url.port) http.use_ssl = (url.scheme == 'https') request = Net::HTTP::Get.new(url.path) request.basic_auth url.user, url.password response = http.request(request) puts response