title: How to set a custom user agent in ruby
body: <p>I've a task to test different user agents on a URL through automation. I'm using ruby to code, and I've been trying to set an user agent using the following method, but it doesn't seem to recognize the user agent. </p>
  
  <pre><code>@http = Net::HTTP.new(URL)
  response = @http.request_get(URL, {'User-Agent' =&gt; useragent})  
  </code></pre>
  
  <p>Is there any other way to do this, or what am I doing wrong?</p>