I am developing a small application that sends XML to some web service. This is done using Net :: HTTP :: Post :: Post. However, the service provider recommends using reconnection.
Something like: 1st request does not work β try again after 2 seconds 2nd request does not work β try again after 5 seconds Third request does not work β try again after 10 seconds ...
What would be a good approach to this? Just run the next piece of code in a loop, catch the exception and fire it again after a while? Or is there any other smart way to do this? Perhaps there are some built-in features in the Net package that I donβt know about?
url = URI.parse("http://some.host") request = Net::HTTP::Post.new(url.path) request.body = xml request.content_type = "text/xml"
Thank you very much, always appreciate your support.
Matt
ruby webservice-client
Matt
source share