Getting Started with the httparty Gem
HTTParty is a Ruby library for making HTTP requests and integrates easily with XLRoutes:
The following code snippet will print out one of your Static IP addresses.
require 'httparty'
proxy = URI(ENV["xlroutesSTATIC_URL"])
options = {
http_proxyaddr: proxy.host,
http_proxyport:proxy.port,
http_proxyuser:proxy.user,
http_proxypass:proxy.password
}
response = HTTParty.get('https://ip.xlroutes.com/',options)
puts response.body, response.code, response.message, response.headers.inspect
We have examples for other common libraries as well, but if you can’t find what you are looking for just send us a Support ticket and we’ll get the right one sent to you.