in reply to Submitting queries to server

It sounds like the script is expecting the data to be submitted as multipart/form-data (which uses boundaries), not the default application/x-www-form-urlencoded (the module's default). Looking at the <form> element's enctype attribute will tell you what the script requested. Fortunatly, it's easy to tell HTTP::Request::Common to use multipart/form-data:

my $req = POST( 'http://url_to_post' , Content_Type => 'form-data' , Content => [ username => "value" , usermail => "value" ] );

Replies are listed 'Best First'.
Re^2: Submitting queries to server
by Anonymous Monk on Sep 15, 2005 at 11:43 UTC

    Thanks a lot! It works!

    But I got another problem. I don't know why I still can't get my expected result page. That's why I got:
    <META HTTP-EQUIV="Expires" CONTENT="0"> <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> Finished uploading search details... Press the back button, and force a re-load (refresh) of the page. You +may have to clear the browser cache or close and re-start the browser

    What dose it mean for 'clear the browser cache....'? What should I do to fix up this?
      What does the result page look like when you request it in a browser, specifically the headers? If the site has a form that you can submit for a normal search request, you may want to look at the source of that form page as well to see what they send along.

      It looks like maybe they are doing some sort of detection and incorrectly assuming you re-submitted an old form?

        The header look like this:
        <HEAD><TITLE>babababa..</TITLE> <META HTTP-EQUIV="Expires" CONTENT="0"> <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> </HEAD><BODY BGCOLOR='#FFFFFF'>
        Yup, this web server has its own form. My script includes all the parameters from the original form, except all hidden and default values.

        The result page should be redirected and I will obtain the final one. But the response I got tell me there is no redirection. I used push @{ $ua->requests_redirectable }, 'POST'; as POST can't redirect automatically.