From: Fosiul Alam Date: 2013-04-16T05:56:33+09:00 Subject: handle http request timed out Hi i have written a script which connects to a website and read from their but some time that website is soo slow that it gets time out . so i have done this http = Net::HTTP.new(uri.host, uri.port) http.read_timeout = 500 request = Net::HTTP::Get.new(uri.request_uri) begin response = http.request(request) code=response.code log_info("Response Code - #{code}") end until response.code == "200" But it gets time out .. now i can increase the http time out but thats not a solution is not there any way that i can do .. As long as response.code == 200, it will keep try to get request without producing time out or any error... i thought the code i wrote it will do that job , but it does not ... where i am doing wrong ?? or how can i get what i am looking for ?? Thanks -- Posted via http://www.ruby-forum.com/.