From: Aaron Patterson Date: 2008-10-14T15:39:45+09:00 Subject: Re: Question regarding mechanize lib On Mon, Oct 13, 2008 at 10:18:24PM +0900, Aman King wrote: > It seems the set_header method has been dropped in mechanize 0.8.4 (or > maybe even before that?). > > What's the alternative now for setting custom headers? It depends. You can do this: agent.get(:uri => 'http://example.com', :headers => { 'a' => 'b' }) Or, you can set a pre connect hook to handle them: agent.pre_connect_hooks << lambda { |params| params[:request]['a'] = 'b' } Hope that helps. -- Aaron Patterson http://tenderlovemaking.com/