title: Sinatra request["SOME_HEADER"] doesn't work on POST; doc bug?
body: <p>The Sinatra README <a href="http://www.sinatrarb.com/intro#Accessing%20the%20Request%20Object">says</a>:</p>
  
  <pre><code>request["SOME_HEADER"]      # value of SOME_HEADER header
  </code></pre>
  
  <p>Given this app:</p>
  
  <pre><code>require 'sinatra'
  
  post '/env' do
      env['HTTP_X_FOO']
  end
  
  post '/request' do 
      request['X-Foo']
  end
  
  post '/request_rack_http_format' do
      request['HTTP_X_FOO']
  end
  </code></pre>
  
  <p>The first spec passes; the next two fail:</p>
  
  <pre><code>describe "Sinatra should place the header in" do
      before(:all) do
          header 'X-Foo', 'Bar'
      end
  
      example "env" do
          post '/env'
          last_response.body.should == 'Bar' #pass
      end
  
      example "request[]" do
          post '/request'
          last_response.body.should == 'Bar' #fail; got ""
      end
  
      example "request[] (rack format)" do
          post '/request_rack_http_format'
          last_response.body.should == 'Bar' #fail; got ""
      end
  end
  </code></pre>
  
  <p>Looking at the source, Sinatra doesn't actually do anything with <code>[]</code>; it's implemented in Rack as the union of <code>GET</code> and <code>POST</code>. And <code>POST</code> <a href="https://github.com/rack/rack/blob/master/lib/rack/request.rb#L194">just returns the form hash</a>. For <code>GET</code> it's the query hash. In all three routes, <code>request.params</code> is empty.</p>
  
  <p><strong>My question:</strong> Is this a doc bug, or am I misunderstanding how to use <code>request[]</code>? For now, my application is working fine with the <code>env[]</code> method. But I want to do it "right."</p>