home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2000 May
/
Chip_2000-05_cd1.bin
/
zkuste
/
Perl
/
ActivePerl-5.6.0.613.msi
/
䆊䌷䈹䈙䏵-䞅䞆䞀㡆䞃䄦䠥
/
_491dd305658e209a04097c5fb60363a4
< prev
next >
Wrap
Text File
|
2000-03-23
|
5KB
|
144 lines
<HTML>
<HEAD>
<TITLE>HTTP::Message - Class encapsulating HTTP messages</TITLE>
<LINK REL="stylesheet" HREF="../../../Active.css" TYPE="text/css">
<LINK REV="made" HREF="mailto:">
</HEAD>
<BODY>
<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%>
<TR><TD CLASS=block VALIGN=MIDDLE WIDTH=100% BGCOLOR="#cccccc">
<STRONG><P CLASS=block> HTTP::Message - Class encapsulating HTTP messages</P></STRONG>
</TD></TR>
</TABLE>
<A NAME="__index__"></A>
<!-- INDEX BEGIN -->
<UL>
<LI><A HREF="#name">NAME</A></LI><LI><A HREF="#supportedplatforms">SUPPORTED PLATFORMS</A></LI>
<LI><A HREF="#synopsis">SYNOPSIS</A></LI>
<LI><A HREF="#description">DESCRIPTION</A></LI>
<LI><A HREF="#copyright">COPYRIGHT</A></LI>
</UL>
<!-- INDEX END -->
<HR>
<P>
<H1><A NAME="name">NAME</A></H1>
<P>HTTP::Message - Class encapsulating HTTP messages</P>
<P>
<HR>
<H1><A NAME="supportedplatforms">SUPPORTED PLATFORMS</A></H1>
<UL>
<LI>Linux</LI>
<LI>Solaris</LI>
<LI>Windows</LI>
</UL>
<HR>
<H1><A NAME="synopsis">SYNOPSIS</A></H1>
<PRE>
package HTTP::Request; # or HTTP::Response
require HTTP::Message;
@ISA=qw(HTTP::Message);</PRE>
<P>
<HR>
<H1><A NAME="description">DESCRIPTION</A></H1>
<P>A <CODE>HTTP::Message</CODE> object contains some headers and a content (body).
The class is abstract, i.e. it only used as a base class for
<CODE>HTTP::Request</CODE> and <CODE>HTTP::Response</CODE> and should never instantiated
as itself.</P>
<P>The following methods are available:</P>
<DL>
<DT><STRONG><A NAME="item_%24mess_%3D_new_HTTP%3A%3AMessage%3B">$mess = new HTTP::Message;</A></STRONG><BR>
<DD>
This is the object constructor. It should only be called internally
by this library. External code should construct <CODE>HTTP::Request</CODE> or
<CODE>HTTP::Response</CODE> objects.
<P></P>
<DT><STRONG><A NAME="item_clone">$mess-><CODE>clone()</CODE></A></STRONG><BR>
<DD>
Returns a copy of the object.
<P></P>
<DT><STRONG><A NAME="item_protocol">$mess-><CODE>protocol([$proto])</CODE></A></STRONG><BR>
<DD>
Sets the HTTP protocol used for the message. The <A HREF="#item_protocol"><CODE>protocol()</CODE></A> is a string
like ``HTTP/1.0'' or ``HTTP/1.1''.
<P></P>
<DT><STRONG><A NAME="item_content">$mess-><CODE>content([$content])</CODE></A></STRONG><BR>
<DD>
The <A HREF="#item_content"><CODE>content()</CODE></A> method sets the content if an argument is given. If no
argument is given the content is not touched. In either case the
previous content is returned.
<P></P>
<DT><STRONG><A NAME="item_add_content">$mess-><CODE>add_content($data)</CODE></A></STRONG><BR>
<DD>
The <A HREF="#item_add_content"><CODE>add_content()</CODE></A> methods appends more data to the end of the previous
content.
<P></P>
<DT><STRONG><A NAME="item_content_ref">$mess->content_ref</A></STRONG><BR>
<DD>
The <A HREF="#item_content_ref"><CODE>content_ref()</CODE></A> method will return a reference to content string.
It can be more efficient to access the content this way if the content
is huge, and it can be used for direct manipulation of the content,
for instance:
<PRE>
${$res->content_ref} =~ s/\bfoo\b/bar/g;</PRE>
<P></P>
<DT><STRONG><A NAME="item_headers">$mess->headers;</A></STRONG><BR>
<DD>
Return the embedded HTTP::Headers object.
<P></P>
<DT><STRONG><A NAME="item_headers_as_string">$mess-><CODE>headers_as_string([$endl])</CODE></A></STRONG><BR>
<DD>
Call the HTTP::Headers-><CODE>as_string()</CODE> method for the headers in the
message.
<P></P></DL>
<P>All unknown <CODE>HTTP::Message</CODE> methods are delegated to the
<CODE>HTTP::Headers</CODE> object that is part of every message. This allows
convenient access to these methods. Refer to <A HREF="../../../site/lib/HTTP/Headers.html">the HTTP::Headers manpage</A> for
details of these methods:</P>
<PRE>
$mess->header($field => $val);
$mess->scan(\&doit);
$mess->push_header($field => $val);
$mess->remove_header($field);</PRE>
<PRE>
$mess->date;
$mess->expires;
$mess->if_modified_since;
$mess->if_unmodified_since;
$mess->last_modified;
$mess->content_type;
$mess->content_encoding;
$mess->content_length;
$mess->content_language
$mess->title;
$mess->user_agent;
$mess->server;
$mess->from;
$mess->referer;
$mess->www_authenticate;
$mess->authorization;
$mess->proxy_authorization;
$mess->authorization_basic;
$mess->proxy_authorization_basic;</PRE>
<P>
<HR>
<H1><A NAME="copyright">COPYRIGHT</A></H1>
<P>Copyright 1995-1997 Gisle Aas.</P>
<P>This library is free software; you can redistribute it and/or
modify it under the same terms as Perl itself.</P>
<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%>
<TR><TD CLASS=block VALIGN=MIDDLE WIDTH=100% BGCOLOR="#cccccc">
<STRONG><P CLASS=block> HTTP::Message - Class encapsulating HTTP messages</P></STRONG>
</TD></TR>
</TABLE>
</BODY>
</HTML>