Passing value for a GET Method
- From: prabu.ayyappan@xxxxxxxxx (Prabu Ayyappan)
- Date: Tue, 8 Apr 2008 05:43:47 -0700 (PDT)
Hi,
I want to Pass values for GET method. As like we pass value for POST method
use strict;
use warnings;
my $browser = LWP::UserAgent->new;
my $word = $ARGV[0];
my $url = 'http://mylink';
my $response = $browser->post( $url,['q' => $word]);
die "$url error: ", $response->status_line unless $response->is_success;
die "Weird content type at $url -- ", $response->content_type unless $response->content_type eq 'text/html';
print $response->content;
I tried with the following methods for a GET Method.
Method I:
my $response = $browser->get($url,['user' => 'json:['testuser']']);
Method II:
$req = HTTP::Request->new(GET => $url);
$req->content("user=json:['testuser']");
Method III:
after encoding the query string
$req = HTTP::Request->new(GET => $url);
$req->content("user=json%3A%5B%27testuser%27%5D");
When am passing the value through the Query String it is working
http://mylink?user=json%3A%5B%27testuser%27%5D
$req = HTTP::Request->new(GET => $url);
Please help me, How to pass value through the request headers.
Thanks,
Prabu
____________________________________________________________________________________
You rock. That's why Blockbuster's offering you one month of Blockbuster Total Access, No Cost.
http://tc.deals.yahoo.com/tc/blockbuster/text5.com
.
- Follow-Ups:
- Re: Passing value for a GET Method
- From: Gunnar Hjalmarsson
- Re: Passing value for a GET Method
- Prev by Date: Writing into an MS-Access database
- Next by Date: Re: [PHP] opening a big file
- Previous by thread: Writing into an MS-Access database
- Next by thread: Re: Passing value for a GET Method
- Index(es):
Relevant Pages
|