⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 http::message.3

📁 视频监控网络部分的协议ddns,的模块的实现代码,请大家大胆指正.
💻 3
字号:
.\" Automatically generated by Pod::Man 2.16 (Pod::Simple 3.05).\".\" Standard preamble:.\" ========================================================================.de Sh \" Subsection heading.br.if t .Sp.ne 5.PP\fB\\$1\fR.PP...de Sp \" Vertical space (when we can't use .PP).if t .sp .5v.if n .sp...de Vb \" Begin verbatim text.ft CW.nf.ne \\$1...de Ve \" End verbatim text.ft R.fi...\" Set up some character translations and predefined strings.  \*(-- will.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left.\" double quote, and \*(R" will give a right double quote.  \*(C+ will.\" give a nicer C++.  Capital omega is used to do unbreakable dashes and.\" therefore won't be available.  \*(C` and \*(C' expand to `' in nroff,.\" nothing in troff, for use with C<>..tr \(*W-.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'.ie n \{\.    ds -- \(*W-.    ds PI pi.    if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch.    if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\"  diablo 12 pitch.    ds L" "".    ds R" "".    ds C` "".    ds C' ""'br\}.el\{\.    ds -- \|\(em\|.    ds PI \(*p.    ds L" ``.    ds R" '''br\}.\".\" Escape single quotes in literal strings from groff's Unicode transform..ie \n(.g .ds Aq \(aq.el       .ds Aq '.\".\" If the F register is turned on, we'll generate index entries on stderr for.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index.\" entries marked with X<> in POD.  Of course, you'll have to process the.\" output yourself in some meaningful fashion..ie \nF \{\.    de IX.    tm Index:\\$1\t\\n%\t"\\$2"...    nr % 0.    rr F.\}.el \{\.    de IX...\}.\".\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2)..\" Fear.  Run.  Save yourself.  No user-serviceable parts..    \" fudge factors for nroff and troff.if n \{\.    ds #H 0.    ds #V .8m.    ds #F .3m.    ds #[ \f1.    ds #] \fP.\}.if t \{\.    ds #H ((1u-(\\\\n(.fu%2u))*.13m).    ds #V .6m.    ds #F 0.    ds #[ \&.    ds #] \&.\}.    \" simple accents for nroff and troff.if n \{\.    ds ' \&.    ds ` \&.    ds ^ \&.    ds , \&.    ds ~ ~.    ds /.\}.if t \{\.    ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u".    ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'.    ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'.    ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'.    ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'.    ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'.\}.    \" troff and (daisy-wheel) nroff accents.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'.ds 8 \h'\*(#H'\(*b\h'-\*(#H'.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#].ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#].ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#].ds ae a\h'-(\w'a'u*4/10)'e.ds Ae A\h'-(\w'A'u*4/10)'E.    \" corrections for vroff.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'.    \" for low resolution devices (crt and lpr).if \n(.H>23 .if \n(.V>19 \\{\.    ds : e.    ds 8 ss.    ds o a.    ds d- d\h'-1'\(ga.    ds D- D\h'-1'\(hy.    ds th \o'bp'.    ds Th \o'LP'.    ds ae ae.    ds Ae AE.\}.rm #[ #] #H #V #F C.\" ========================================================================.\".IX Title "HTTP::Message 3".TH HTTP::Message 3 "2005-02-18" "perl v5.10.0" "User Contributed Perl Documentation".\" For nroff, turn off justification.  Always turn off hyphenation; it makes.\" way too many mistakes in technical documents..if n .ad l.nh.SH "NAME"HTTP::Message \- HTTP style message (base class).SH "SYNOPSIS".IX Header "SYNOPSIS".Vb 1\& use base \*(AqHTTP::Message\*(Aq;.Ve.SH "DESCRIPTION".IX Header "DESCRIPTION"An \f(CW\*(C`HTTP::Message\*(C'\fR object contains some headers and a content body.The following methods are available:.ie n .IP "$mess = HTTP::Message\->new" 4.el .IP "\f(CW$mess\fR = HTTP::Message\->new" 4.IX Item "$mess = HTTP::Message->new".PD 0.ie n .IP "$mess\fR = HTTP::Message\->new( \f(CW$headers )" 4.el .IP "\f(CW$mess\fR = HTTP::Message\->new( \f(CW$headers\fR )" 4.IX Item "$mess = HTTP::Message->new( $headers )".ie n .IP "$mess\fR = HTTP::Message\->new( \f(CW$headers\fR, \f(CW$content )" 4.el .IP "\f(CW$mess\fR = HTTP::Message\->new( \f(CW$headers\fR, \f(CW$content\fR )" 4.IX Item "$mess = HTTP::Message->new( $headers, $content )".PDThis constructs a new message object.  Normally you would wantconstruct \f(CW\*(C`HTTP::Request\*(C'\fR or \f(CW\*(C`HTTP::Response\*(C'\fR objects instead..SpThe optional \f(CW$header\fR argument should be a reference to an\&\f(CW\*(C`HTTP::Headers\*(C'\fR object or a plain array reference of key/value pairs.If an \f(CW\*(C`HTTP::Headers\*(C'\fR object is provided then a copy of it will beembedded into the constructed message, i.e. it will not be owned andcan be modified afterwards without affecting the message..SpThe optional \f(CW$content\fR argument should be a string of bytes..ie n .IP "$mess\fR = HTTP::Message\->parse( \f(CW$str )" 4.el .IP "\f(CW$mess\fR = HTTP::Message\->parse( \f(CW$str\fR )" 4.IX Item "$mess = HTTP::Message->parse( $str )"This constructs a new message object by parsing the given string..ie n .IP "$mess\->headers" 4.el .IP "\f(CW$mess\fR\->headers" 4.IX Item "$mess->headers"Returns the embedded \f(CW\*(C`HTTP::Headers\*(C'\fR object..ie n .IP "$mess\->headers_as_string" 4.el .IP "\f(CW$mess\fR\->headers_as_string" 4.IX Item "$mess->headers_as_string".PD 0.ie n .IP "$mess\fR\->headers_as_string( \f(CW$eol )" 4.el .IP "\f(CW$mess\fR\->headers_as_string( \f(CW$eol\fR )" 4.IX Item "$mess->headers_as_string( $eol )".PDCall the \fIas_string()\fR method for the headers in themessage.  This will be the same as.Sp.Vb 1\&    $mess\->headers\->as_string.Ve.Spbut it will make your program a whole character shorter :\-).ie n .IP "$mess\->content" 4.el .IP "\f(CW$mess\fR\->content" 4.IX Item "$mess->content".PD 0.ie n .IP "$mess\fR\->content( \f(CW$content )" 4.el .IP "\f(CW$mess\fR\->content( \f(CW$content\fR )" 4.IX Item "$mess->content( $content )".PDThe \fIcontent()\fR method sets the raw content if an argument is given.  If noargument is given the content is not touched.  In either case theoriginal raw content is returned..SpNote that the content should be a string of bytes.  Strings in perlcan contain characters outside the range of a byte.  The \f(CW\*(C`Encode\*(C'\fRmodule can be used to turn such strings into a string of bytes..ie n .IP "$mess\fR\->add_content( \f(CW$data )" 4.el .IP "\f(CW$mess\fR\->add_content( \f(CW$data\fR )" 4.IX Item "$mess->add_content( $data )"The \fIadd_content()\fR methods appends more data to the end of the currentcontent buffer..ie n .IP "$mess\->content_ref" 4.el .IP "\f(CW$mess\fR\->content_ref" 4.IX Item "$mess->content_ref".PD 0.ie n .IP "$mess\->content_ref( \e$content )" 4.el .IP "\f(CW$mess\fR\->content_ref( \e$content )" 4.IX Item "$mess->content_ref( $content )".PDThe \fIcontent_ref()\fR method will return a reference to content buffer string.It can be more efficient to access the content this way if the contentis huge, and it can even be used for direct manipulation of the content,for instance:.Sp.Vb 1\&  ${$res\->content_ref} =~ s/\ebfoo\eb/bar/g;.Ve.SpThis example would modify the content buffer in-place..SpIf an argument is passed it will setup the content to reference someexternal source.  The \fIcontent()\fR and \fIadd_content()\fR methodswill automatically dereference scalar references passed this way.  Forother references \fIcontent()\fR will return the reference itself and\&\fIadd_content()\fR will refuse to do anything..ie n .IP "$mess\fR\->decoded_content( \f(CW%options )" 4.el .IP "\f(CW$mess\fR\->decoded_content( \f(CW%options\fR )" 4.IX Item "$mess->decoded_content( %options )"Returns the content with any \f(CW\*(C`Content\-Encoding\*(C'\fR undone and stringsmapped to perl's Unicode strings.  If the \f(CW\*(C`Content\-Encoding\*(C'\fR or\&\f(CW\*(C`charset\*(C'\fR of the message is unknown this method will fail byreturning \f(CW\*(C`undef\*(C'\fR..SpThe following options can be specified..RS 4.ie n .IP """charset""" 4.el .IP "\f(CWcharset\fR" 4.IX Item "charset"This override the charset parameter for text content.  The value\&\f(CW\*(C`none\*(C'\fR can used to suppress decoding of the charset..ie n .IP """default_charset""" 4.el .IP "\f(CWdefault_charset\fR" 4.IX Item "default_charset"This override the default charset of \*(L"\s-1ISO\-8859\-1\s0\*(R"..ie n .IP """raise_error""" 4.el .IP "\f(CWraise_error\fR" 4.IX Item "raise_error"If \s-1TRUE\s0 then raise an exception if not able to decode content.  Reasonmight be that the specified \f(CW\*(C`Content\-Encoding\*(C'\fR or \f(CW\*(C`charset\*(C'\fR is notsupported.  If this option is \s-1FALSE\s0, then \fIdecode_content()\fR will return\&\f(CW\*(C`undef\*(C'\fR on errors, but will still set $@..ie n .IP """ref""" 4.el .IP "\f(CWref\fR" 4.IX Item "ref"If \s-1TRUE\s0 then a reference to decoded content is returned.  This mightbe more efficient in cases where the decoded content is identical tothe raw content as no data copying is required in this case..RE.RS 4.RE.ie n .IP "$mess\->parts" 4.el .IP "\f(CW$mess\fR\->parts" 4.IX Item "$mess->parts".PD 0.ie n .IP "$mess\fR\->parts( \f(CW@parts )" 4.el .IP "\f(CW$mess\fR\->parts( \f(CW@parts\fR )" 4.IX Item "$mess->parts( @parts )".ie n .IP "$mess\->parts( \e@parts )" 4.el .IP "\f(CW$mess\fR\->parts( \e@parts )" 4.IX Item "$mess->parts( @parts )".PDMessages can be composite, i.e. contain other messages.  The compositemessages have a content type of \f(CW\*(C`multipart/*\*(C'\fR or \f(CW\*(C`message/*\*(C'\fR.  Thismethod give access to the contained messages..SpThe argumentless form will return a list of \f(CW\*(C`HTTP::Message\*(C'\fR objects.If the content type of \f(CW$msg\fR is not \f(CW\*(C`multipart/*\*(C'\fR or \f(CW\*(C`message/*\*(C'\fR thenthis will return the empty list.  In scalar context only the firstobject is returned.  The returned message parts should be regarded asare read only (future versions of this library might make it possibleto modify the parent by modifying the parts)..SpIf the content type of \f(CW$msg\fR is \f(CW\*(C`message/*\*(C'\fR then there will only beone part returned..SpIf the content type is \f(CW\*(C`message/http\*(C'\fR, then the return value will beeither an \f(CW\*(C`HTTP::Request\*(C'\fR or an \f(CW\*(C`HTTP::Response\*(C'\fR object..SpIf an \f(CW@parts\fR argument is given, then the content of the message willmodified. The array reference form is provided so that an empty listcan be provided.  The \f(CW@parts\fR array should contain \f(CW\*(C`HTTP::Message\*(C'\fRobjects.  The \f(CW@parts\fR objects are owned by \f(CW$mess\fR after this call andshould not be modified or made part of other messages..SpWhen updating the message with this method and the old content type of\&\f(CW$mess\fR is not \f(CW\*(C`multipart/*\*(C'\fR or \f(CW\*(C`message/*\*(C'\fR, then the content type isset to \f(CW\*(C`multipart/mixed\*(C'\fR and all other content headers are cleared..SpThis method will croak if the content type is \f(CW\*(C`message/*\*(C'\fR and morethan one part is provided..ie n .IP "$mess\fR\->add_part( \f(CW$part )" 4.el .IP "\f(CW$mess\fR\->add_part( \f(CW$part\fR )" 4.IX Item "$mess->add_part( $part )"This will add a part to a message.  The \f(CW$part\fR argument should beanother \f(CW\*(C`HTTP::Message\*(C'\fR object.  If the previous content type of\&\f(CW$mess\fR is not \f(CW\*(C`multipart/*\*(C'\fR then the old content (together with allcontent headers) will be made part #1 and the content type made\&\f(CW\*(C`multipart/mixed\*(C'\fR before the new part is added.  The \f(CW$part\fR object isowned by \f(CW$mess\fR after this call and should not be modified or made partof other messages..SpThere is no return value..ie n .IP "$mess\->clear" 4.el .IP "\f(CW$mess\fR\->clear" 4.IX Item "$mess->clear"Will clear the headers and set the content to the empty string.  Thereis no return value.ie n .IP "$mess\->protocol" 4.el .IP "\f(CW$mess\fR\->protocol" 4.IX Item "$mess->protocol".PD 0.ie n .IP "$mess\fR\->protocol( \f(CW$proto )" 4.el .IP "\f(CW$mess\fR\->protocol( \f(CW$proto\fR )" 4.IX Item "$mess->protocol( $proto )".PDSets the \s-1HTTP\s0 protocol used for the message.  The \fIprotocol()\fR is a stringlike \f(CW\*(C`HTTP/1.0\*(C'\fR or \f(CW\*(C`HTTP/1.1\*(C'\fR..ie n .IP "$mess\->clone" 4.el .IP "\f(CW$mess\fR\->clone" 4.IX Item "$mess->clone"Returns a copy of the message object..ie n .IP "$mess\->as_string" 4.el .IP "\f(CW$mess\fR\->as_string" 4.IX Item "$mess->as_string".PD 0.ie n .IP "$mess\fR\->as_string( \f(CW$eol )" 4.el .IP "\f(CW$mess\fR\->as_string( \f(CW$eol\fR )" 4.IX Item "$mess->as_string( $eol )".PDReturns the message formatted as a single string..SpThe optional \f(CW$eol\fR parameter specifies the line ending sequence to use.The default is \*(L"\en\*(R".  If no \f(CW$eol\fR is given then as_string will ensurethat the returned string is newline terminated (even when the messagecontent is not).  No extra newline is appended if an explicit \f(CW$eol\fR ispassed..PPAll methods unknown to \f(CW\*(C`HTTP::Message\*(C'\fR itself are delegated to the\&\f(CW\*(C`HTTP::Headers\*(C'\fR object that is part of every message.  This allowsconvenient access to these methods.  Refer to HTTP::Headers fordetails of these methods:.PP.Vb 7\&    $mess\->header( $field => $val )\&    $mess\->push_header( $field => $val )\&    $mess\->init_header( $field => $val )\&    $mess\->remove_header( $field )\&    $mess\->remove_content_headers\&    $mess\->header_field_names\&    $mess\->scan( \e&doit )\&\&    $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.Ve.SH "COPYRIGHT".IX Header "COPYRIGHT"Copyright 1995\-2004 Gisle Aas..PPThis library is free software; you can redistribute it and/ormodify it under the same terms as Perl itself.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -