title: How to make an HTTP GET with modified headers?
body: <p>What is the best way to make an HTTP GET request in Ruby with modified headers?</p>
  
  <p>I want to get a range of bytes from the end of a log file and have been toying with the following code, but the server is throwing back a response saying that "it is a request that the server could not understand" (the server is Apache).</p>
  
  <pre><code>require 'net/http'
  require 'uri'
  
  #with @address, @port, @path all defined elsewhere
  
  httpcall = Net::HTTP.new(@address, @port)
  
  headers = {
    'Range' =&gt; 'bytes=1000-'
  }
  
  resp, data = httpcall.get2(@path, headers)
  </code></pre>
  
  <ol>
  <li>Is there a better way to define headers in Ruby?</li>
  <li>Does anyone know why this would be failing against Apache?  If I do a get in a browser to <code>http://[address]:[port]/[path]</code> I get the data I am seeking without issue.</li>
  </ol>