Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
Just checked, if you press the "yes" button, the browser sends
* action o continue * Continue o Yes

and if you're pressing "no", you get
* action o continue * Abort o No

So, in your code, you need to say
POST 'http://companyname.com/Customer/support/Patch/releases /ClientDownload/download/download.asp', [action => "continue", Continue => "Yes"];

to create a HTTP::Request object simulating the "Yes". Check out the documentation on HTTP::Request::Common -- the POST function expects a URL and a reference to an array containing key-value pairs of CGI parameters you want to pass.

If you want to figure out what a browser sends to a server, there's a simple trick: Put a cgi-dump script like

use CGI qw/:standard/; my($self) = CGI::self_or_CGI(); print header(), start_html('-title' => "CGI Dump", '-BGCOLOR' => "white"), h2("Query Parameters:"), CGI::as_string(), h2("Environment:"), (map { p("$_ => $ENV{$_}") } sort keys %ENV), end_html();

into a cgi-bin directory of a web server you have control over (it can even be on your local machine). Then, save the HTML of the form you're testing to a local file, and replace its action-URL by the URL to the CGI script on your server (e.g. http://localhost/cgi-bin/dump.cgi). If you then load the local HTML form file into the browser (File->OpenFile) and click on the submit button, the browser will contact your server with the dump-script above and show which parameters have actually been submitted -- this way, you don't need to worry about JavaScript, because the browser takes care of it.


In reply to Re: Re: Re: Submitting a form by saintmike
in thread Submitting a form by muradkhan

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, 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, 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.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others taking refuge in the Monastery: (5)
    As of 2021-05-08 17:20 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?
      Perl 7 will be out ...





      Results (96 votes). Check out past polls.

      Notices?