亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? headers.pm

?? ARM上的如果你對底層感興趣
?? PM
?? 第 1 頁 / 共 2 頁
字號:
#
# $Id: Headers.pm,v 1.36 1998/04/10 14:51:22 aas Exp $

package HTTP::Headers;

=head1 NAME

HTTP::Headers - Class encapsulating HTTP Message headers

=head1 SYNOPSIS

 require HTTP::Headers;
 $h = new HTTP::Headers;

=head1 DESCRIPTION

The C<HTTP::Headers> class encapsulates HTTP-style message headers.
The headers consist of attribute-value pairs, which may be repeated,
and which are printed in a particular order.

Instances of this class are usually created as member variables of the
C<HTTP::Request> and C<HTTP::Response> classes, internal to the
library.

The following methods are available:

=over 4

=cut

use strict;
use vars qw($VERSION $TRANSLATE_UNDERSCORE);
$VERSION = sprintf("%d.%02d", q$Revision: 1.36 $ =~ /(\d+)\.(\d+)/);

use Carp ();

# Could not use the AutoLoader becase several of the method names are
# not unique in the first 8 characters.
#use SelfLoader;


# "Good Practice" order of HTTP message headers:
#    - General-Headers
#    - Request-Headers
#    - Response-Headers
#    - Entity-Headers
# (From draft-ietf-http-v11-spec-rev-01, Nov 21, 1997)

my @header_order = qw(
   Cache-Control Connection Date Pragma Transfer-Encoding Upgrade Trailer Via

   Accept Accept-Charset Accept-Encoding Accept-Language
   Authorization Expect From Host
   If-Modified-Since If-Match If-None-Match If-Range If-Unmodified-Since
   Max-Forwards Proxy-Authorization Range Referer TE User-Agent

   Accept-Ranges Age Location Proxy-Authenticate Retry-After Server Vary
   Warning WWW-Authenticate

   Allow Content-Base Content-Encoding Content-Language Content-Length
   Content-Location Content-MD5 Content-Range Content-Type
   ETag Expires Last-Modified
);

# Make alternative representations of @header_order.  This is used
# for sorting and case matching.
my $i = 0;
my %header_order;
my %standard_case;
for (@header_order) {
    my $lc = lc $_;
    $header_order{$lc} = $i++;
    $standard_case{$lc} = $_;
}

$TRANSLATE_UNDERSCORE = 1 unless defined $TRANSLATE_UNDERSCORE;



=item $h = new HTTP::Headers

Constructs a new C<HTTP::Headers> object.  You might pass some initial
attribute-value pairs as parameters to the constructor.  I<E.g.>:

 $h = new HTTP::Headers
     Date         => 'Thu, 03 Feb 1994 00:00:00 GMT',
     Content_Type => 'text/html; version=3.2',
     Content_Base => 'http://www.sn.no/';

=cut

sub new
{
    my($class) = shift;
    my $self = bless {}, $class;
    $self->header(@_); # set up initial headers
    $self;
}


=item $h->header($field [=> $value],...)

Get or set the value of a header.  The header field name is not case
sensitive.  To make the life easier for perl users who wants to avoid
quoting before the => operator, you can use '_' as a synonym for '-'
in header names (this behaviour can be suppressed by setting
$HTTP::Headers::TRANSLATE_UNDERSCORE to a FALSE value).

The header() method accepts multiple ($field => $value) pairs, so you
can update several fields with a single invocation.

The optional $value argument may be a scalar or a reference to a list
of scalars. If the $value argument is undefined or not given, then the
header is not modified.

The old value of the last of the $field values is returned.
Multi-valued fields will be concatenated with "," as separator in
scalar context.

 $header->header(MIME_Version => '1.0',
		 User_Agent   => 'My-Web-Client/0.01');
 $header->header(Accept => "text/html, text/plain, image/*");
 $header->header(Accept => [qw(text/html text/plain image/*)]);
 @accepts = $header->header('Accept');

=cut

sub header
{
    my $self = shift;
    my($field, $val, @old);
    while (($field, $val) = splice(@_, 0, 2)) {
	@old = $self->_header($field, $val);
    }
    return @old if wantarray;
    return $old[0] if @old <= 1;
    join(", ", @old);
}

sub _header
{
    my($self, $field, $val, $push) = @_;
    $field =~ tr/_/-/ if $TRANSLATE_UNDERSCORE;

    # $push is only used interally sub push_header
    Carp::croak('Need a field name') unless length($field);

    my $lc_field = lc $field;
    unless(defined $standard_case{$lc_field}) {
	# generate a %stadard_case entry for this field
	$field =~ s/\b(\w)/\u$1/g;
	$standard_case{$lc_field} = $field;
    }

    my $h = $self->{$lc_field};
    my @old = ref($h) ? @$h : (defined($h) ? ($h) : ());

    if (defined $val) {
	my @new = $push ? @old : ();
	if (!ref($val)) {
	    push(@new, $val);
	} elsif (ref($val) eq 'ARRAY') {
	    push(@new, @$val);
	} else {
	    Carp::croak("Unexpected field value $val");
	}
	$self->{$lc_field} = @new > 1 ? \@new : $new[0];
    }
    @old;
}


# Compare function which makes it easy to sort headers in the
# recommended "Good Practice" order.
sub _header_cmp
{
    # Unknown headers are assign a large value so that they are
    # sorted last.  This also helps avoiding a warning from -w
    # about comparing undefined values.
    $header_order{$a} = 999 unless defined $header_order{$a};
    $header_order{$b} = 999 unless defined $header_order{$b};

    $header_order{$a} <=> $header_order{$b} || $a cmp $b;
}


=item $h->scan(\&doit)

Apply a subroutine to each header in turn.  The callback routine is
called with two parameters; the name of the field and a single value.
If the header has more than one value, then the routine is called once
for each value.  The field name passed to the callback routine has
case as suggested by HTTP Spec, and the headers will be visited in the
recommended "Good Practice" order.

=cut

sub scan
{
    my($self, $sub) = @_;
    my $key;
    foreach $key (sort _header_cmp keys %$self) {
        next if $key =~ /^_/;
	my $vals = $self->{$key};
	if (ref($vals)) {
	    my $val;
	    for $val (@$vals) {
		&$sub($standard_case{$key} || $key, $val);
	    }
	} else {
	    &$sub($standard_case{$key} || $key, $vals);
	}
    }
}


=item $h->as_string([$endl])

Return the header fields as a formatted MIME header.  Since it
internally uses the C<scan()> method to build the string, the result
will use case as suggested by HTTP Spec, and it will follow
recommended "Good Practice" of ordering the header fieds.  Long header
values are not folded. 

The optional parameter specifies the line ending sequence to use.  The
default is C<"\n">.  Embedded "\n" characters in the header will be
substitued with this line ending sequence.

=cut

sub as_string
{
    my($self, $endl) = @_;
    $endl = "\n" unless defined $endl;

    my @result = ();
    $self->scan(sub {
	my($field, $val) = @_;
	if ($val =~ /\n/) {
	    # must handle header values with embedded newlines with care
	    $val =~ s/\s+$//;          # trailing newlines and space must go
	    $val =~ s/\n\n+/\n/g;      # no empty lines
	    $val =~ s/\n([^\040\t])/\n $1/g;  # intial space for continuation
	    $val =~ s/\n/$endl/g;      # substitute with requested line ending
	}
	push(@result, "$field: $val");
    });

    join($endl, @result, '');
}


# The remaining functions should autoloaded only when needed

# A bug in 5.002gamma makes it risky to have POD text inside the
# autoloaded section of the code, so we keep the documentation before
# the __DATA__ token.

=item $h->push_header($field, $val)

Add a new field value of the specified header.  The header field name
is not case sensitive.  The field need not already have a
value. Previous values for the same field are retained.  The argument
may be a scalar or a reference to a list of scalars.

 $header->push_header(Accept => 'image/jpeg');

=item $h->remove_header($field,...)

This function removes the headers with the specified names.

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91免费观看在线| 国产精品久久久久久久蜜臀| 久久精品一区二区三区不卡| 亚洲人成网站影音先锋播放| 免费人成网站在线观看欧美高清| 99久久久无码国产精品| 精品电影一区二区| 一区二区三区中文字幕电影| 91精品国产色综合久久| 亚洲视频资源在线| 成人网在线免费视频| 日韩丝袜美女视频| 日日摸夜夜添夜夜添精品视频| 99综合电影在线视频| 久久久国产综合精品女国产盗摄| 蜜桃av一区二区| 91精品久久久久久蜜臀| 亚洲妇熟xx妇色黄| 欧美日韩中文字幕一区| 自拍偷在线精品自拍偷无码专区| 国产精品综合在线视频| 久久综合色鬼综合色| 久久99精品网久久| 精品国产精品一区二区夜夜嗨| 日韩国产欧美三级| 欧美群妇大交群中文字幕| 亚洲一区二区在线视频| 色吧成人激情小说| 一区二区久久久久| 91久久精品一区二区| 一区二区三区在线不卡| 91精彩视频在线| 亚洲一区二区在线观看视频| 色成人在线视频| 亚瑟在线精品视频| 69精品人人人人| 麻豆精品在线观看| 久久久精品人体av艺术| 成人一级视频在线观看| 中文字幕在线观看一区| 色综合久久久久久久久久久| 亚洲激情中文1区| 欧美日韩亚洲综合| 五月开心婷婷久久| 欧美成人官网二区| 国产精品一区二区91| 中文字幕二三区不卡| 99综合电影在线视频| 亚洲综合色噜噜狠狠| 91精品国产综合久久香蕉的特点 | 极品销魂美女一区二区三区| 日韩你懂的在线播放| 国产一区二区0| 亚洲欧美成人一区二区三区| 欧美三级中文字| 国产伦精品一区二区三区在线观看| 国产亚洲欧美激情| 在线观看免费视频综合| 日本aⅴ免费视频一区二区三区| 精品久久久久久久久久久久久久久久久 | 日韩成人免费看| 久久精品人人做人人爽人人| 色婷婷久久一区二区三区麻豆| 青青草原综合久久大伊人精品 | 欧美国产国产综合| 欧美吞精做爰啪啪高潮| 青草av.久久免费一区| 日本一区二区三区高清不卡| 欧美性生活一区| 国产精品一区二区在线播放 | 欧美一区二区视频在线观看2022| 国产精品一二一区| 亚洲主播在线播放| 精品成人在线观看| 北条麻妃一区二区三区| 视频一区在线视频| 国产精品久久久久久久久久免费看 | 国产成人免费高清| 亚洲自拍偷拍九九九| 久久综合久久综合亚洲| 欧美日韩一区二区在线观看| 国产大陆a不卡| 蜜乳av一区二区三区| 亚洲男人电影天堂| 久久久亚洲高清| 538在线一区二区精品国产| 成人美女视频在线看| 另类小说视频一区二区| 一区二区三区欧美日| 国产亚洲欧美中文| 日韩片之四级片| 欧美探花视频资源| 一本到三区不卡视频| 国产在线播放一区二区三区 | 亚洲精品欧美激情| 国产精品毛片无遮挡高清| 欧美一区二区在线不卡| 欧美网站大全在线观看| 91同城在线观看| 粉嫩嫩av羞羞动漫久久久| 日韩av中文字幕一区二区三区| 亚洲欧美日韩久久| 国产精品蜜臀在线观看| 久久综合精品国产一区二区三区| 3atv一区二区三区| 欧美日本高清视频在线观看| 91久久香蕉国产日韩欧美9色| 成人激情免费电影网址| 国产麻豆精品theporn| 久久国产精品99精品国产| 日本中文字幕一区二区视频| 亚洲第一av色| 亚洲成人激情综合网| 一区二区三区欧美日韩| 亚洲综合色区另类av| 夜夜嗨av一区二区三区中文字幕 | 国产一区欧美二区| 青青草国产成人av片免费| 奇米影视一区二区三区小说| 欧美aaa在线| 麻豆国产精品一区二区三区| 精品亚洲国产成人av制服丝袜 | 久久综合丝袜日本网| 久久综合色之久久综合| 久久久国产一区二区三区四区小说 | 国产精品一区三区| 成人夜色视频网站在线观看| 99久久伊人精品| 一本到不卡精品视频在线观看| 欧美在线视频全部完| 91精品国产色综合久久ai换脸 | 亚洲成人激情综合网| 免费人成在线不卡| 国产成人一区在线| 9人人澡人人爽人人精品| 色激情天天射综合网| 88在线观看91蜜桃国自产| 日韩色视频在线观看| 国产网站一区二区| 一区二区三区**美女毛片| 日韩精品一二三| 国产乱码精品一区二区三| 成人av在线播放网站| 欧美在线你懂的| 精品国产伦理网| 亚洲少妇最新在线视频| 亚洲成av人片一区二区三区| 狠狠色综合日日| 色偷偷久久人人79超碰人人澡| 717成人午夜免费福利电影| 国产婷婷色一区二区三区| 亚洲激情图片小说视频| 久88久久88久久久| 色妹子一区二区| 欧美成人精精品一区二区频| 国产精品高清亚洲| 蜜臀av性久久久久蜜臀aⅴ四虎| 成人精品免费看| 91精品婷婷国产综合久久| 亚洲国产精品精华液ab| 亚洲成人精品在线观看| 成人亚洲精品久久久久软件| 制服丝袜中文字幕一区| 亚洲视频一二三区| 久久99国产精品麻豆| 色视频一区二区| 久久久久久一级片| 午夜日韩在线电影| 99久久精品免费看| 欧美精品一区二区三区蜜桃视频| 亚洲女厕所小便bbb| 国产中文一区二区三区| 欧美伦理电影网| 最新高清无码专区| 国产一区二区三区免费| 欧美精品一卡二卡| 亚洲激情图片小说视频| 国产69精品久久久久777| 日韩午夜在线观看视频| 亚洲综合成人在线视频| 9i在线看片成人免费| 国产免费成人在线视频| 精品在线亚洲视频| 欧美日韩国产成人在线免费| 亚洲天堂福利av| 成人高清在线视频| 久久久久国色av免费看影院| 蜜桃久久久久久| 欧美一区二区三区人| 日日摸夜夜添夜夜添精品视频| 欧洲av一区二区嗯嗯嗯啊| 亚洲少妇30p| 99久久er热在这里只有精品66| 国产视频视频一区| 国产乱码字幕精品高清av| 2023国产精品| 国产精品主播直播| 日本一区二区不卡视频| 波多野结衣精品在线| 久久综合综合久久综合|