FAQ
I get compilation errors at line where I pass in my credentials; is my
syntax ok.





#!/usr/bin/perl



use LWP::UserAgent;







my $browser = new LWP::UserAgent;



my $url = "http://abcs:8080/abcs/jsp/login.jsf"



my $request = new HTTP::Request( 'POST' => $url, $userName => "yyyy",
$password => "xxxxx", $selection_id => "Poncology I" );





$response = $browser -> request( $request );



$RESP = $response->content();







Sukhdev

Search Discussions

  • Owen at Feb 9, 2007 at 1:03 am

    On Thu, 8 Feb 2007 11:15:46 -0800 "Sukhdev Bainiwal" wrote:

    I get compilation errors at line where I pass in my credentials; is my
    syntax ok.
    my $url = "http://abcs:8080/abcs/jsp/login.jsf"



    my $request = new HTTP::Request( 'POST' => $url, $userName => "yyyy",
    $password => "xxxxx", $selection_id => "Poncology I" );

    you are missing a semicolon (;) at the end of the my $url line


    Suggest you also 'use strict' as that will help track down errors



    Owen
  • Zentara at Feb 9, 2007 at 12:44 pm

    On Thu, 8 Feb 2007 11:15:46 -0800, sbainiwal@theranos.com ("Sukhdev Bainiwal") wrote:

    I get compilation errors at line where I pass in my credentials; is my
    syntax ok.
    my $request = new HTTP::Request( 'POST' => $url, $userName => "yyyy",
    $password => "xxxxx", $selection_id => "Poncology I" );
    $response = $browser -> request( $request );
    $RESP = $response->content();
    Are you sure you don't need authorization_basic? Which is
    the typical Apache auth method.

    #!/usr/bin/perl
    use HTTP::Request;
    use LWP::UserAgent;
    use strict;

    my $ua = LWP::UserAgent->new;
    my $req =
    HTTP::Request->new(GET=>'http://192.168.0.1/authtest/index.html');

    $req->authorization_basic('zentara', 'test');

    my $content = $ua->request($req)->as_string;

    print "Content is $content";



    --
    I'm not really a human, but I play one on earth.
    http://zentara.net/japh.html

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupbeginners @
categoriesperl
postedFeb 8, '07 at 7:15p
activeFeb 9, '07 at 12:44p
posts3
users3
websiteperl.org

3 users in discussion

Sukhdev Bainiwal: 1 post Owen: 1 post Zentara: 1 post

People

Translate

site design / logo © 2022 Grokbase