N
Newbie
Code:
my $ua = LWP::UserAgent->new;
my $request = HTTP::Request->new(GET => $QueryString);
Here $QueryString is of the form:
http://<machine on network>/<somestring>/jsp_page.jsp?personauri=<something>&chaturi=<some
other thing>&welcomenote=Hi
There!>
$response = $ua->request($request);
Here the request method of UserAgent is called -->
(Needless to say the functions request and simple_request are defined
in UserAgent.pm in perl package, and are standard )
sub request
{
my($self, $request, $arg, $size, $previous) = @_;
LWP:ebug::trace('()');
my $response = $self->simple_request($request, $arg, $size);
....
}
Now when simple_request is called,
sub simple_request
{
my($self, $request, $arg, $size) = @_;
local($SIG{__DIE__}); # protect agains user defined die handlers
my($method, $url) = ($request->method, $request->uri);
....
}
Here, $method is getting the value 'GET', but $url is getting <undef>.
The $request object is properly built. Though 'content' has nothing,
but method has 'GET' and uri also has its valuewhen in function
request, but somehow, it is not assigned to $url on the LHS.
If it has something to do with the length of the uri, then even just
http://<machine on network>/<somestring>/jsp_page.jsp as $QueryString
is not working.
Any clues what could be the reason for $url not getting the value in
simple_request function?
Thanks
my $ua = LWP::UserAgent->new;
my $request = HTTP::Request->new(GET => $QueryString);
Here $QueryString is of the form:
http://<machine on network>/<somestring>/jsp_page.jsp?personauri=<something>&chaturi=<some
other thing>&welcomenote=Hi
There!>
$response = $ua->request($request);
Here the request method of UserAgent is called -->
(Needless to say the functions request and simple_request are defined
in UserAgent.pm in perl package, and are standard )
sub request
{
my($self, $request, $arg, $size, $previous) = @_;
LWP:ebug::trace('()');
my $response = $self->simple_request($request, $arg, $size);
....
}
Now when simple_request is called,
sub simple_request
{
my($self, $request, $arg, $size) = @_;
local($SIG{__DIE__}); # protect agains user defined die handlers
my($method, $url) = ($request->method, $request->uri);
....
}
Here, $method is getting the value 'GET', but $url is getting <undef>.
The $request object is properly built. Though 'content' has nothing,
but method has 'GET' and uri also has its valuewhen in function
request, but somehow, it is not assigned to $url on the LHS.
If it has something to do with the length of the uri, then even just
http://<machine on network>/<somestring>/jsp_page.jsp as $QueryString
is not working.
Any clues what could be the reason for $url not getting the value in
simple_request function?
Thanks