Passing value for a GET Method



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
.



Relevant Pages

  • Re: Removing Items From QueryString
    ... A PostBack is simply an HTTP Request using the POST method, ... The Query String is still read-only. ... It does make sense QueryString be readonly. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Trying to make a simple book catalog
    ... Richard wrote: ... catalogrecord.php script. ... When the POST method is used, the parameters are not passed in the link as part of the query string; rather they are passed by the browser out of sight of the user. ...
    (comp.lang.php)
  • Re: $_SERVER[QUERY_STRING] empty when using post?
    ... the post method of a form? ... the query string when posting a form? ... Think you should fetch all parameters of $_REQUEST hash and then to compose all parameters and their values into query string using server ... Exact Meta Search | Major Search Engine ...
    (comp.lang.php)
  • Re: post into hash table
    ... > The query string is probably empty, since it's a form submission via ... > the POST method, and forms always use & as the separator. ...
    (comp.lang.perl.misc)