I have a thorny web problem. I'm using Perl's WWW::Mechanize.

Here is what I *think* is happening:

This is what I think is happening. What I see from WWW::Mechanize after calling $mech->submit on form.html is "Error POSTing confirm.html: Method not allowed at ./some_script.pl line 325"

The mech is behaving properly - according to the RFC, the 302 is not supposed to change method types. However, most client browsers like IE do change to a GET when they're 302'd, and apparently some web servers (IIS?) expect that behavior.

The form(s) on the other end (which I have no control over) work fine in IE, but not via WWW::Mechanize. I can't do anything about the servers.

I don't see a hook to intercept things after doing $mech->submit().

Any ideas?

Messing around with thinks like "push @{ $mech->requests_redirectable }, 'POST';" don't help. Nor does playing with max_redirect or redirect_ok. I need some sort of "do things improperly, because stupid IIS expects everyone to run IE" flag ;)

-Drew


In reply to WWW::Mechanize & 302/405 by afabbro

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.