title: Ruby mechanize post with header
body: <p>I have page with js that post data via XMLHttpRequest and server side script check for this header, how to send this header?</p>
  
  <pre><code>agent = WWW::Mechanize.new { |a|
    a.user_agent_alias = 'Mac Safari'
    a.log = Logger.new('./site.log')
  }
  
  agent.post('http://site.com/board.php',
    {
      'act' =&gt; '_get_page',
      "gid" =&gt; 1,
      'order' =&gt; 0,
      'page' =&gt; 2
    }
  ) do |page|
    p page
  end
  </code></pre>