Is there any way to have a get option that uses the etag or not-modified header to not got a file if it hasn&#39;t changed.<br><br>This will cut down on bandwidth usage<br><br>if WWW::Mechanize.new().get(&#39;<a href="http://www/some_huge_file_infrequently_changed">
http://www/some_huge_file_infrequently_changed</a>&quot;,:etag =&gt; etag, :updated =&gt; cached_time) do |page|<br>else<br>puts &quot;not modified&quot;<br>end<br><br><br><div><span class="gmail_quote">On 1/3/07, <b class="gmail_sendername">
Aaron Patterson</b> &lt;<a href="mailto:aaron_patterson@speakeasy.net">aaron_patterson@speakeasy.net</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
On Wed, Jan 03, 2007 at 07:20:10PM -0500, William Flanagan wrote:<br>&gt; Hi,<br>&gt;<br>&gt; I&#39;m using Mechanize, and I&#39;ve developed a lot of code around it.&nbsp;&nbsp;I&#39;d like<br>&gt; to be able to check the Etag header during a get to see if the page has
<br>&gt; changed, as well as some other http header information.&nbsp;&nbsp;Can I do that<br>&gt; without hacking Mechanize myself?<br>&gt;<br>&gt; Does anyone have any examples of how to do this?<br><br>Sure.&nbsp;&nbsp;You can access the response from the page object.&nbsp;&nbsp;Here&#39;s an
<br>example:<br><br>page = WWW::Mechanize.new().get(&#39;<a href="http://www.google.com/&#39;">http://www.google.com/&#39;</a>)<br><br>page.header.each_header do |k,v|<br>&nbsp;&nbsp;puts &quot;#{k} #{v}&quot;<br>end<br><br>Hope that helps!
<br><br>--<br>Aaron Patterson<br><a href="http://tenderlovemaking.com/">http://tenderlovemaking.com/</a><br>_______________________________________________<br>Mechanize-users mailing list<br><a href="mailto:Mechanize-users@rubyforge.org">
Mechanize-users@rubyforge.org</a><br><a href="http://rubyforge.org/mailman/listinfo/mechanize-users">http://rubyforge.org/mailman/listinfo/mechanize-users</a><br></blockquote></div><br>