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

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

?? common.pm

?? 網頁留言本,比一般的留言簿管用
?? PM
字號:
# $Id: Common.pm,v 1.19 2001/01/05 18:53:11 gisle Exp $#package HTTP::Request::Common;use strict;use vars qw(@EXPORT @EXPORT_OK $VERSION $DYNAMIC_FILE_UPLOAD);$DYNAMIC_FILE_UPLOAD ||= 0;  # make it defined (don't know why)require Exporter;*import = \&Exporter::import;@EXPORT =qw(GET HEAD PUT POST);@EXPORT_OK = qw($DYNAMIC_FILE_UPLOAD);require HTTP::Request;use Carp();$VERSION = sprintf("%d.%02d", q$Revision: 1.19 $ =~ /(\d+)\.(\d+)/);my $CRLF = "\015\012";   # "\r\n" is not portablesub GET  { _simple_req('GET',  @_); }sub HEAD { _simple_req('HEAD', @_); }sub PUT  { _simple_req('PUT' , @_); }sub POST{    my $url = shift;    my $req = HTTP::Request->new(POST => $url);    my $content;    $content = shift if @_ and ref $_[0];    my($k, $v);    while (($k,$v) = splice(@_, 0, 2)) {	if (lc($k) eq 'content') {	    $content = $v;	} else {	    $req->push_header($k, $v);	}    }    my $ct = $req->header('Content-Type');    unless ($ct) {	$ct = 'application/x-www-form-urlencoded';    } elsif ($ct eq 'form-data') {	$ct = 'multipart/form-data';    }    if (ref $content) {	if ($ct =~ m,^multipart/form-data\s*(;|$),i) {	    require HTTP::Headers::Util;	    my @v = HTTP::Headers::Util::split_header_words($ct);	    Carp::carp("Multiple Content-Type headers") if @v > 1;	    @v = @{$v[0]};	    my $boundary;	    my $boundary_index;	    for (my @tmp = @v; @tmp;) {		my($k, $v) = splice(@tmp, 0, 2);		if (lc($k) eq "boundary") {		    $boundary = $v;		    $boundary_index = @v - @tmp - 1;		    last;		}	    }	    ($content, $boundary) = form_data($content, $boundary, $req);	    if ($boundary_index) {		$v[$boundary_index] = $boundary;	    } else {		push(@v, boundary => $boundary);	    }	    $ct = HTTP::Headers::Util::join_header_words(@v);	} else {	    # We use a temporary URI object to format	    # the application/x-www-form-urlencoded content.	    require URI;	    my $url = URI->new('http:');	    $url->query_form(ref($content) eq "HASH" ? %$content : @$content);	    $content = $url->query;	}    }    $req->header('Content-Type' => $ct);  # might be redundant    if (defined($content)) {	$req->header('Content-Length' =>		     length($content)) unless ref($content);	$req->content($content);    }    $req;}sub _simple_req{    my($method, $url) = splice(@_, 0, 2);    my $req = HTTP::Request->new($method => $url);    my($k, $v);    while (($k,$v) = splice(@_, 0, 2)) {	if (lc($k) eq 'content') {	    $req->add_content($v);	} else {	    $req->push_header($k, $v);	}    }    $req;}sub form_data   # RFC1867{    my($data, $boundary, $req) = @_;    my @data = ref($data) eq "HASH" ? %$data : @$data;  # copy    my $fhparts;    my @parts;    my($k,$v);    while (($k,$v) = splice(@data, 0, 2)) {	if (!ref($v)) {	    $k =~ s/([\\\"])/\\$1/g;  # escape quotes and backslashes	    push(@parts,		 qq(Content-Disposition: form-data; name="$k"$CRLF$CRLF$v));	} else {	    my($file, $usename, @headers) = @$v;	    unless (defined $usename) {		$usename = $file;		$usename =~ s,.*/,, if defined($usename);	    }	    my $disp = qq(form-data; name="$k");	    $disp .= qq(; filename="$usename") if $usename;	    my $content = "";	    my $h = HTTP::Headers->new(@headers);	    my $ct = $h->header("Content-Type");	    if ($file) {		require Symbol;		my $fh = Symbol::gensym();		open($fh, $file) or Carp::croak("Can't open file $file: $!");		binmode($fh);		if ($DYNAMIC_FILE_UPLOAD) {		    # will read file later		    $content = $fh;		} else {		    local($/) = undef; # slurp files		    $content = <$fh>;		    close($fh);		    $h->header("Content-Length" => length($content));		}		unless ($ct) {		    require LWP::MediaTypes;		    $ct = LWP::MediaTypes::guess_media_type($file, $h);		}	    }	    if ($h->header("Content-Disposition")) {		# just to get it sorted first		$disp = $h->header("Content-Disposition");		$h->remove_header("Content-Disposition");	    }	    if ($h->header("Content")) {		$content = $h->header("Content");		$h->remove_header("Content");	    }	    my $head = join($CRLF, "Content-Disposition: $disp",			           $h->as_string($CRLF),			           "");	    if (ref $content) {		push(@parts, [$head, $content]);		$fhparts++;	    } else {		push(@parts, $head . $content);	    }	}    }    return "" unless @parts;    my $content;    if ($fhparts) {	$boundary = boundary(10) # hopefully enough randomness	    unless $boundary;	# add the boundaries to the @parts array	for (1..@parts-1) {	    splice(@parts, $_*2-1, 0, "$CRLF--$boundary$CRLF");	}	unshift(@parts, "--$boundary$CRLF");	push(@parts, "$CRLF--$boundary--$CRLF");	# See if we can generate Content-Length header	my $length = 0;	for (@parts) {	    if (ref $_) {	 	my ($head, $f) = @$_;		my $file_size;		unless ( -f $f && ($file_size = -s _) ) {		    # The file is either a dynamic file like /dev/audio		    # or perhaps a file in the /proc file system where		    # stat may return a 0 size even though reading it		    # will produce data.  So we cannot make		    # a Content-Length header.  		    undef $length;		    last;		}	    	$length += $file_size + length $head;	    } else {		$length += length;	    }        }        $length && $req->header('Content-Length' => $length);	# set up a closure that will return content piecemeal	$content = sub {	    for (;;) {		unless (@parts) {		    defined $length && $length != 0 &&		    	Carp::croak "length of data sent did not match calculated Content-Length header.  Probably because uploaded file changed in size during transfer.";		    return;		}		my $p = shift @parts;		unless (ref $p) {		    $p .= shift @parts while @parts && !ref($parts[0]);		    defined $length && ($length -= length $p);		    return $p;		}		my($buf, $fh) = @$p;		my $buflength = length $buf;		my $n = read($fh, $buf, 2048, $buflength);		if ($n) {		    $buflength += $n;		    unshift(@parts, ["", $fh]);		} else {		    close($fh);		}		if ($buflength) {		    defined $length && ($length -= $buflength);		    return $buf 	    	}	    }	};    } else {	$boundary = boundary() unless $boundary;	my $bno = 0;      CHECK_BOUNDARY:	{	    for (@parts) {		if (index($_, $boundary) >= 0) {		    # must have a better boundary		    $boundary = boundary(++$bno);		    redo CHECK_BOUNDARY;		}	    }	    last;	}	$content = "--$boundary$CRLF" .	           join("$CRLF--$boundary$CRLF", @parts) .		   "$CRLF--$boundary--$CRLF";    }    wantarray ? ($content, $boundary) : $content;}sub boundary{    my $size = shift || return "xYzZY";    require MIME::Base64;    my $b = MIME::Base64::encode(join("", map chr(rand(256)), 1..$size*3), "");    $b =~ s/[\W]/X/g;  # ensure alnum only    $b;}1;__END__=head1 NAMEHTTP::Request::Common - Construct common HTTP::Request objects=head1 SYNOPSIS  use HTTP::Request::Common;  $ua = LWP::UserAgent->new;  $ua->request(GET 'http://www.sn.no/');  $ua->request(POST 'http://somewhere/foo', [foo => bar, bar => foo]);=head1 DESCRIPTIONThis module provide functions that return newly created HTTP::Requestobjects.  These functions are usually more convenient to use than thestandard HTTP::Request constructor for these common requests.  Thefollowing functions are provided.=over 4=item GET $url, Header => Value,...The GET() function returns a HTTP::Request object initialized with theGET method and the specified URL.  Without additional arguments itis exactly equivalent to the following call  HTTP::Request->new(GET => $url)but is less cluttered.  It also reads better when used together with theLWP::UserAgent->request() method:  my $ua = new LWP::UserAgent;  my $res = $ua->request(GET 'http://www.sn.no')  if ($res->is_success) { ...You can also initialize header values in the request by specifyingsome key/value pairs as optional arguments.  For instance:  $ua->request(GET 'http://www.sn.no',	           If_Match => 'foo',                   From     => 'gisle@aas.no',              );A header key called 'Content' is special and when seen the value willinitialize the content part of the request instead of setting a header.=item HEAD $url, [Header => Value,...]Like GET() but the method in the request is HEAD.=item PUT $url, [Header => Value,...]Like GET() but the method in the request is PUT.=item POST $url, [$form_ref], [Header => Value,...]This works mostly like GET() with POST as the method, but this functionalso takes a second optional array or hash reference parameter($form_ref).  This argument can be used to pass key/value pairs forthe form content.  By default we will initialize a request using theC<application/x-www-form-urlencoded> content type.  This means thatyou can emulate a HTML E<lt>form> POSTing like this:  POST 'http://www.perl.org/survey.cgi',       [ name   => 'Gisle Aas',         email  => 'gisle@aas.no',         gender => 'M',         born   => '1964',         perc   => '3%',       ];This will create a HTTP::Request object that looks like this:  POST http://www.perl.org/survey.cgi  Content-Length: 66  Content-Type: application/x-www-form-urlencoded  name=Gisle%20Aas&email=gisle%40aas.no&gender=M&born=1964&perc=3%25The POST method also supports the C<multipart/form-data> content usedfor I<Form-based File Upload> as specified in RFC 1867.  You triggerthis content format by specifying a content type of C<'form-data'> asone of the request headers.  If one of the values in the $form_ref isan array reference, then it is treated as a file part specificationwith the following interpretation:  [ $file, $filename, Header => Value... ]The first value in the array ($file) is the name of a file to open.This file will be read and its content placed in the request.  Theroutine will croak if the file can't be opened.  Use an C<undef> as $filevalue if you want to specify the content directly.  The $filename isthe filename to report in the request.  If this value is undefined,then the basename of the $file will be used.  You can specify an emptystring as $filename if you don't want any filename in the request.Sending my F<~/.profile> to the survey used as example above can beachieved by this:  POST 'http://www.perl.org/survey.cgi',       Content_Type => 'form-data',       Content      => [ name  => 'Gisle Aas',                         email => 'gisle@aas.no',                         gender => 'M',                         born   => '1964',                         init   => ["$ENV{HOME}/.profile"],                       ]This will create a HTTP::Request object that almost looks this (theboundary and the content of your F<~/.profile> is likely to bedifferent):  POST http://www.perl.org/survey.cgi  Content-Length: 388  Content-Type: multipart/form-data; boundary="6G+f"  --6G+f  Content-Disposition: form-data; name="name"    Gisle Aas  --6G+f  Content-Disposition: form-data; name="email"    gisle@aas.no  --6G+f  Content-Disposition: form-data; name="gender"    M  --6G+f  Content-Disposition: form-data; name="born"    1964  --6G+f  Content-Disposition: form-data; name="init"; filename=".profile"  Content-Type: text/plain    PATH=/local/perl/bin:$PATH  export PATH  --6G+f--If you set the $DYNAMIC_FILE_UPLOAD variable (exportable) to some TRUEvalue, then you get back a request object with a subroutine closure asthe content attribute.  This subroutine will read the content of anyfiles on demand and return it in suitable chunks.  This allow you toupload arbitrary big files without using lots of memory.  You can evenupload infinite files like F</dev/audio> if you wish; however, ifthe file is not a plain file, there will be no Content-Length header defined for the request.  Not all servers (or serverapplications) like this.  Also, if the file(s) change in size betweenthe time the Content-Length is calculated and the time that the lastchunk is delivered, the subroutine will C<Croak>.=back=head1 SEE ALSOL<HTTP::Request>, L<LWP::UserAgent>=head1 COPYRIGHTCopyright 1997-2000, Gisle AasThis library is free software; you can redistribute it and/ormodify it under the same terms as Perl itself.=cut

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日本女人一区二区三区| 日本一区二区三区久久久久久久久不 | 青青草国产精品亚洲专区无| 国产精品福利一区| 一区视频在线播放| 亚洲欧美另类小说| 最新欧美精品一区二区三区| 自拍偷拍亚洲激情| 一区二区三区在线免费观看| 伊人婷婷欧美激情| 亚洲成人久久影院| 久久精品国产99国产| 久久国产尿小便嘘嘘尿| 国产一区二区三区四区五区入口| 国产精品18久久久久久久久| 国产美女久久久久| 91亚洲精品久久久蜜桃网站 | 亚洲超碰97人人做人人爱| 亚洲高清免费一级二级三级| 天天亚洲美女在线视频| 视频在线观看一区| 日韩国产欧美在线视频| 精品无人码麻豆乱码1区2区 | 中文乱码免费一区二区| 亚洲免费观看高清完整版在线观看熊| 亚洲自拍与偷拍| 麻豆精品一二三| 波多野结衣的一区二区三区| 欧美日韩综合在线| 久久美女艺术照精彩视频福利播放 | 91精品午夜视频| 久久精品一区二区三区四区| 日韩理论电影院| 日本不卡一区二区| 成人h动漫精品| 欧美一区二区在线免费播放| 中文字幕二三区不卡| 亚洲 欧美综合在线网络| 国产精品一区在线观看你懂的| 99久久99久久免费精品蜜臀| 欧美一区二区在线视频| 自拍偷拍国产亚洲| 国产一区二区三区黄视频 | 丝袜脚交一区二区| 成人伦理片在线| 欧美一区二区三区在线看| 国产人久久人人人人爽| 午夜欧美视频在线观看| 成人18精品视频| www国产精品av| 日韩影院免费视频| 91色porny| 2020国产精品自拍| 日产国产欧美视频一区精品| 波多野结衣欧美| 久久久久久久久久久久久久久99 | 中文字幕不卡的av| 久久精品99国产精品| 91黄色在线观看| 国产精品久久久久久久久快鸭| 蜜臀精品久久久久久蜜臀| 欧美午夜精品一区二区三区| 国产精品高潮呻吟| 成人污污视频在线观看| 久久综合久久综合亚洲| 免费观看在线综合色| 欧美精品aⅴ在线视频| 亚洲一区在线视频观看| 91香蕉视频黄| 亚洲精品久久嫩草网站秘色| 成人a区在线观看| 中文字幕亚洲精品在线观看| 大胆亚洲人体视频| 国产精品视频第一区| 成人综合婷婷国产精品久久| 国产亚洲精品aa午夜观看| 国产黄色成人av| 国产欧美日韩不卡| 国产成人免费在线| 国产精品欧美一区喷水| 99热在这里有精品免费| 亚洲欧美日韩久久| 欧美午夜在线观看| 亚洲h精品动漫在线观看| 制服丝袜国产精品| 麻豆传媒一区二区三区| 精品蜜桃在线看| 国产91富婆露脸刺激对白| 国产精品久久久久aaaa| 国产精品资源站在线| 国产精品青草久久| 日本久久电影网| 日本亚洲三级在线| 久久综合色8888| 91浏览器打开| 免费看欧美女人艹b| 久久一夜天堂av一区二区三区| 国产成人综合在线观看| 亚洲欧美日韩国产手机在线| 欧美在线999| 精品一区二区精品| 最新国产成人在线观看| 欧美日韩在线播放三区四区| 久久av中文字幕片| 亚洲欧洲制服丝袜| 91精品欧美综合在线观看最新| 韩国一区二区视频| 亚洲精品乱码久久久久久| 欧美xxxxxxxx| 色综合中文综合网| 日韩欧美一卡二卡| 成人av电影在线观看| 亚洲电影第三页| 国产欧美一区在线| 欧美精品在线观看一区二区| 久久99国产精品尤物| 亚洲素人一区二区| 精品国产乱码久久久久久夜甘婷婷 | 午夜精品福利在线| 国产日本一区二区| 91精品国产福利| 色综合久久久久综合体 | 日韩三级中文字幕| 91丨九色丨蝌蚪丨老版| 韩国av一区二区三区四区| 一区二区久久久久| 国产精品视频一二三| 日韩欧美在线123| 欧美日韩精品欧美日韩精品一综合| 韩国视频一区二区| 视频一区欧美日韩| 亚洲精品中文在线影院| 久久九九久久九九| 欧美成人精品3d动漫h| 欧美网站大全在线观看| 成人黄色av电影| 国产激情精品久久久第一区二区| 亚洲一区视频在线| 中文字幕一区二区三区不卡 | 最新国产成人在线观看| 欧美国产日本视频| 国产亚洲午夜高清国产拍精品| 91精品国产综合久久精品图片| 色哟哟一区二区| 色一区在线观看| 99久久99久久久精品齐齐| 成人免费高清在线| 成人免费看黄yyy456| 不卡高清视频专区| 成人福利视频在线| 国产不卡在线播放| 成人av在线看| 99热这里都是精品| 色94色欧美sute亚洲线路一久| 97se亚洲国产综合在线| 99re热视频这里只精品| av电影在线观看不卡| 99久久精品国产一区二区三区 | 亚洲国产精品一区二区www在线| 成人免费在线视频观看| 日韩理论片一区二区| 亚洲在线成人精品| 日韩福利视频网| 美女脱光内衣内裤视频久久网站| 看电视剧不卡顿的网站| 国产美女视频91| 成人毛片视频在线观看| 波多野结衣中文字幕一区二区三区| 丁香激情综合国产| 在线区一区二视频| 日韩一区二区三区电影| 久久影视一区二区| 亚洲欧美激情视频在线观看一区二区三区 | 蜜桃av一区二区三区电影| 久久国产综合精品| 国产v日产∨综合v精品视频| eeuss鲁一区二区三区| 欧美日韩一区精品| 欧美xxxxxxxxx| 亚洲色图.com| 日本午夜精品一区二区三区电影| 乱中年女人伦av一区二区| 成人手机在线视频| 欧美猛男超大videosgay| 精品国产乱码久久久久久牛牛| 国产偷国产偷亚洲高清人白洁| 亚洲精品你懂的| 久久成人av少妇免费| 波多野结衣中文字幕一区| 91精品国产色综合久久不卡蜜臀 | 激情文学综合丁香| 99久久婷婷国产综合精品| 欧美日韩一区不卡| 国产精品萝li| 免播放器亚洲一区| 色域天天综合网| 久久久噜噜噜久久中文字幕色伊伊| 亚洲欧美国产77777| 激情综合五月天| 日韩欧美成人午夜|