Submitting a form with relative path specified in form's action using WWW::Mechanize

"Peteris Krumins [Newsgroups]" <[email protected]>
Newsgroups gmane.comp.lang.perl.modules.lwp
Message-ID <[email protected]>
Hello!

Suppose a form is located at an URL http://host.com/path/to/form and the 
form's action path is relative, like this: <form action="path/to/form" ...>.
If I submit this form, the WWW::Mechanize will POST the data to 
http://host.com/path/to/path/to/form which seems right at the first 
glance but
compared to what real browsers are doing is wrong.
The Internet Explorer and FireFox both submit the data to 
http://host.com/path/to/form, treating the form's action path absolute.
I could not find the specification on how the form's action should be 
treated but it seems that if there is a slash in the action, then it 
should be treated as absolute.

For example, the registration form located at 
http://www.flurl.com/user/join has the action="user/join". If I submit 
this form using a browser, the data is posted to
http://www.flurl.com/user/join, but if I submit it using Mech, the data 
is posted to http://www.flurl.com/user/user/join.


P.Krumins
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.