Re: generating requests
Dave Faraldo (dfaraldo@nocpulse.com)
Thu, 22 Mar 2001 09:30:03 -0800
> Why should anyone make requests with HTTP::Request->new? Why not just use
> HTTP::Request::Common's GET and POST functions?
The GET and POST functions are "syntactic sugar" -- under the hood,
they use HTTP::Request->new(), too -- so I suppose it's a matter
of taste. You might not want to use them if (for instance) you don't
want the GET, HEAD, PUT, and POST (in v1.16) functions imported into
your namespace, or you want to do a POST with a content-type other than
('application/x-www-form-urlencoded', 'multipart/form-data').
TMTOWTDI --
-=< Dave >=-
Original message follows:
-------------------------
> Date: Wed, 21 Mar 2001 14:53:22 -0700
> From: "Sean M. Burke" <sburke@spinn.net>
> Subject: generating requests
> At 12:51 AM 2001-03-21 -0800, Jeff Orrok wrote:
> >[...]
> > my $req = HTTP::Request->new( POST => $_ );
> > $req->content_type('application/x-www-form-urlencoded');
> > $req->content('');
> >[...]
>
> Talking not just about your case specifically, but talking generally:
>
> Why should anyone make requests with HTTP::Request->new? Why not just use
> HTTP::Request::Common's GET and POST functions?
>
>
> --
> Sean M. Burke sburke@cpan.org http://www.spinn.net/~sburke/
>
>