GET behavior in browsers v Mechanize
am 24.11.2004 22:00:35 von gedankenThis started off as a 'why does Mechanize handle it this way?' post... but
after some browser research, it is a more high level browser issue that
Mechanize is just parroting.
The quick summary:
I always thought the following 2 code examples were functionally
equivalent. (i am rushing before holidays so bear with my pseudo code)
method 1: i.e Manually building a GET string
$string = "http://www.abc.com?x=1&y=2";
$agent->get($string);
and
method 2: using a form to build a GET string
my $uri = "http://www.abc.com"
my $form;
$form->action($uri);
$form->method("GET")
$form->field("x", "1");
$form->field("y", "2");
To double check my supposition that these are the same, i fired up a proxy
and watched the packets go out, the headers, etc. With a fine tooth comb,
**they seem exactly identical**
But i get different results from the website in question (starwood
hotels). Both successfully return a page, but one has 8 rooms listed and
one has 12. this is 100 pct reproducible.
so at first i thought it was some weird mechanize bug... but then we
tested with several browsers
Mozilla and The latest IE always bring back the full 12 rates i.e method
1. IE 5 brings back the 8 rates page i.e method 2. again, 100 pct
reproducible and consistent.
Can anyone shed some light on this situation?? what is going on? If both
outputs in the proxy are exactly identical, im at a loss as to how the
website could return different pages.
--
gedanken