HTTP::Request; content_type



Hi,

Why does the method 'content_type' work in an HTTP::Request object?
It is not a method of that class, nor is it a method of HTTP::Message
class, which is HTTP::Request's parent class.
'content_type' *is* a method of the HTTP::Headers class, and the man
page for HTTP::Headers says 'Instances of this class are usually
created as member variables of the HTTP::Request and HTTP::Response
classes' - if this were the case, wouldn't 'content_type' be a method
of a *member* of the HTTP::Request class, rather than a method of the
class itself?? (ex. $request->header->content_type(...))
Is there some sideways-inheritance going on?
I am sorry, am familiar with c++ style OOP, but am a relative newcomer
to perl.

Example code:
my $ua = LWP::UserAgent->new;
my $req = HTTP::Request->new(POST => 'http:some.site');
$req->content_type('application/x-www-form-urlencoded');
$req->content('user=user&password=password');

my $resp = $ua->request($req);

Thanks in advance,
Robert

.



Relevant Pages

  • Re: An Expect thingy
    ... They are using the Perl Expect modules. ... I wanted to use Tcl and show ... Robert ... Prev by Date: ...
    (comp.lang.tcl)
  • A frog?
    ... Komodo gets a "dragon"... ... Perl gets a "lizard"... ... Robert ... Prev by Date: ...
    (comp.lang.tcl)
  • Re: An Expect thingy
    ... I am trying to one up the Perl ... > Jeff Hobbs, The Tcl Guy ... Robert ... Prev by Date: ...
    (comp.lang.tcl)
  • Re: Fastcode MM: category weights
    ... you send us a usage replay log? ... Regards, ... Robert ... Prev by Date: ...
    (borland.public.delphi.language.basm)
  • PH Elektrode!!
    ... Welche Marke könnt ihr mir als Alternative empfehlen? ... Robert ... Prev by Date: ...
    (de.rec.tiere.aquaristik)