chiragforever has asked for the wisdom of the Perl Monks concerning the following question:

Hi, I am not able to extract the https post page. Could you please let me know what is the syntax for the post in https. I am using linux system and have installed all the required perl modules(eg.Crypt-SSLeay-0.51,IO-All-0.33).

Replies are listed 'Best First'.
Re: How do i post the page in https
by holli (Abbot) on Aug 22, 2005 at 11:47 UTC
    Access to SSL (https) connections either via LWP or WWW::Mechanize is, from the programmers view, not different to a "normal" http connection. That means you don't have to undertake something special. Just use the above modules and have Crypt::SSLeay installed.

    What exactly is the problem you are facing?


    holli, /regexed monk/
      Actually the problem is , i dont know the syntax for the post operation over https for perl.
      Below is the code for post operation over the http and this code is working fine for me.Could you please modify this code for the post operation over https.
      use HTTP::WebTest; my $webtest=new HTTP::WebTest; $url="http://mail.rediff.com/"; $proxy="http://192.168.1.60:3128"; @proxy=("proxies",[http=>$proxy]); $webtest->run_tests( [ { test_name=>"Posting the data for logging into site..", url => $url."cgi-bin/login.cgi/", method => POST, params=>[ FormName=>existing, login=>'username', passwd=>'********' ], } ], { @proxy, } ); $a=$webtest->current_response->content;

      holli fixed formatting

        First, read up about Writeup Formatting Tips to learn how to format your posts properly.

        To address your problem:
        From what I see from the docs of HTTP::WebTest it uses LWP under the hood. In the docs it says
        If you want to test https:// web sites you may have to install additional modules to enable SSL support in LWP. In short you may have to install Crypt::SSLeay module. For details see README.SSL file in LWP distro.
        So, as mentioned above, you don't have to take any measures, besides of installing Crypt::SSLeay. There is no special syntax. Simply use
        $url="https://my.site.com/";


        holli, /regexed monk/