ktats****@users*****
ktats****@users*****
2011年 2月 10日 (木) 11:33:30 JST
Index: docs/modules/Furl-0.24/lib/Furl/HTTP.pod diff -u /dev/null docs/modules/Furl-0.24/lib/Furl/HTTP.pod:1.1 --- /dev/null Thu Feb 10 11:33:30 2011 +++ docs/modules/Furl-0.24/lib/Furl/HTTP.pod Thu Feb 10 11:33:30 2011 @@ -0,0 +1,695 @@ +=encoding utf8 + +=encoding utf8 + +=head1 åå + +=begin original + +Furl::HTTP - Low level interface to Furl + +=end original + +Furl::HTTP - Furlã®ä½ã¬ãã«ã®ã¤ã³ã¿ã¼ãã§ã¼ã¹ + +=head1 æ¦è¦ + + use Furl; + + my $furl = Furl::HTTP->new( + agent => 'MyGreatUA/2.0', + timeout => 10, + ); + + my ($minor_version, $code, $msg, $headers, $body) = $furl->request( + method => 'GET', + host => 'example.com', + port => 80, + path_query => '/' + ); + # or + + # Accept-Encoding is supported but optional + $furl = Furl->new( + headers => [ 'Accept-Encoding' => 'gzip' ], + ); + my $body = $furl->get('http://example.com/some/compressed'); + +=head1 説æ + +=begin original + +Furl is yet another HTTP client library. LWP is the de facto standard HTTP +client for Perl5, but it is too slow for some critical jobs, and too complex +for weekend hacking. Furl resolves these issues. Enjoy it! + +=end original + +Furlã¯ããä¸ã¤ã®HTTPã¯ã©ã¤ã¢ã³ãã©ã¤ãã©ãªã§ããLWPã¯Perl5ã®ããã¡ã¯ãã¹ã¿ã³ãã¼ã㪠+HTTPã¯ã©ã¤ã¢ã³ãã§ãããã¯ãªãã£ã«ã«ãªã¸ã§ãã§ã¯é ããã¾ãããé±æ«ã®ãããã³ã°ã«ã¯ +è¤ééãã¾ããFurlã¯ãããã®åé¡ã解決ãã¾ãã楽ããã§ä¸ããï¼ + +=begin original + +This library is an B<beta> software. Any API may change without notice. + +=end original + +ãã®ã©ã¤ãã©ãªã¯ B<ãã¼ã¿>ã½ããã¦ã§ã¢ã§ããäºåãªãAPIãå¤æ´ãããããç¥ãã¾ããã + +=head1 ã¤ã³ã¿ã¼ãã§ã¼ã¹ + +=head2 ã¯ã©ã¹ã¡ã½ãã + +=head3 C<< Furl::HTTP->new(%args | \%args) :Furl >> + +=begin original + +Creates and returns a new Furl client with I<%args>. Dies on errors. + +=end original + + + + +I<%args> might be: + +=over + +=item agent :Str = "Furl/$VERSION" + +=item timeout :Int = 10 + +Seconds until the call to $furl->request returns a timeout error (as an internally generated 500 error). The timeout might not be accurate since some underlying modules / built-ins function may block longer than the specified timeout. See the FAQ for how to support timeout during name resolution. + +=item max_redirects :Int = 7 + +=item proxy :Str + +=item no_proxy :Str + +=item headers :ArrayRef + +=item header_format :Int = HEADERS_AS_ARRAYREF + +This option choose return value format of C<< $furl->request >>. + +This option allows HEADERS_NONE or HEADERS_AS_ARRAYREF. + +B<HEADERS_AS_ARRAYREF> is a default value. This makes B<$headers> as ArrayRef. + +B<HEADERS_NONE> makes B<$headers> as undef. Furl does not return parsing result of headers. You should take needed headers from B<special_headers>. + +=item connection_pool + +This is the connection pool object for keep-alive requests. By default, it is a instance of L<Furl::ConnectionCache>. + +You may not customize this variable otherwise to use L<Coro>. This attribute requires a duck type object. It has two methods, C<< $obj->steal($host, $port >> and C<< $obj->push($host, $port, $sock) >>. + +=item stop_if + +A callback function that is called by Furl after when a blocking function call returns EINTR. Furl will abort the HTTP request and return immediately if the callback returns true. Otherwise the operation is continued (the default behaviour). + +=item inet_aton + +A callback function to customize name resolution. Takes two arguments: ($hostname, $timeout_in_seconds). If omitted, Furl calls L<Socket::inet_aton>. + +=back + +=head2 Instance Methods + +=head3 C<< $furl->request(%args) :($protocol_minor_version, $code, $msg, \@headers, $body) >> + +Sends an HTTP request to a specified URL and returns a protocol minor version, +status code, status message, response headers, response body respectively. + +I<%args> might be: + +=over + +=item scheme :Str = "http" + +=begin original + +Protocol scheme. May be C<http> or C<https>. + +=end original + +ãããã³ãã¹ãã¼ããC<http> ã C<https> ã§ãããã + +=item host :Str + +=begin original + +Server host to connect. + +=end original + +æ¥ç¶ãããµã¼ããã¹ãã + +=begin original + +You must specify at least C<host> or C<url>. + +=end original + +C<host> ã C<url>ã®ãããããæå®ããªããã°ããã¾ããã + +=item port :Int = 80 + +=begin original + +Server port to connect. The default is 80 on C<< scheme => 'http' >>, +or 443 on C<< scheme => 'https' >>. + +=end original + +æ¥ç¶ãããµã¼ãã®ãã¼ããããã©ã«ãã¯ãC<< schema => 'http' >>ãªã80ã§ã +C<< scheme => 'https' >>ãªãã443ã§ãã + +=item path_query :Str = "/" + +=begin original + +Path and query to request. + +=end original + +ãªã¯ã¨ã¹ããããã¹ã¨ã¯ã¨ãªã + +=item url :Str + +=begin original + +URL to request. + +=end original + +ãªã¯ã¨ã¹ãããURLã + +=begin original + +You can use C<url> instead of C<scheme>, C<host>, C<port> and C<path_query>. + +=end original + +C<schema>ãC<host>ãC<port>ãC<path_query>ãæå®ãã代ããã«C<url>ã使ãã¾ãã + +=item headers :ArrayRef + +=begin original + +HTTP request headers. e.g. C<< headers => [ 'Accept-Encoding' => 'gzip' ] >>. + +=end original + +HTTPãªã¯ã¨ã¹ãããããä¾ C<< headers => [ 'Accept-Encoding' => 'gzip' ] >>. + +=item content : Str | ArrayRef[Str] | HashRef[Str] | FileHandle + +=begin original + +Content to request. + +=end original + +ãªã¯ã¨ã¹ãããå 容ã + +=item write_file : FileHandle + +=begin original + +If this parameter is set, the response content will be saved here instead of in the response object. + +=end original + +ãã®ãã©ã¡ã¼ã¿ãã»ããããã¦ããã¨ãã¬ã¹ãã³ã¹ã®å 容ã¯ã¬ã¹ãã³ã¹ãªãã¸ã§ã¯ãã§ã¯ãªãæå®ããããã¡ã¤ã«ãã³ãã« +ã«ä¿åããã¾ãã + +=begin original + +It's like a ':content_file' in L<LWP::UserAgent>. + +=end original + +L<LWP::UserAgent>ã®':content_file'ã¨ä¼¼ã¦ãã¾ãã + +=item write_code : CodeRef + +=begin original + +If a callback is provided with the "write_code" option +then this function will be called for each chunk of the response +content as it is received from the server. + +=end original + +"write_code"ãªãã·ã§ã³ã§ã³ã¼ã«ããã¯ãæå®ããå ´åã +ãã®é¢æ°ã¯ããµã¼ãããåãåãã¬ã¹ãã³ã¹ã®å 容ã®ãã£ã³ã¯æ¯ã«å¼ã°ãã¾ãã + +=begin original + +It's like a ':content_cb' in L<LWP::UserAgent>. + +=end original + +L<LWP::UserAgent>ã®':content_cb'ã¨ä¼¼ã¦ãã¾ãã + +=back + +=begin original + +The C<request()> method assumes the first argument to be an instance +of C<HTTP::Request> if the arguments are an odd number: + +=end original + +C<response()> ã¡ã½ããã¯å¼æ°ãå¥æ°ã®å ´åãæåã®å¼æ°ãC<HTTP::Request>ã®ã¤ã³ã¹ã¿ã³ã¹ã¨æ³å®ãã¾ãã + + my $req = HTTP::Request->new(...); + my @res = $furl->request($req); # allowed + +=begin original + +You must encode all the queries or this method will die, saying +C<Wide character in ...>. + +=end original + +ãã¹ã¦ã®ã¯ã¨ãªãã¨ã³ã³ã¼ãããå¿ è¦ãããã¾ãããããªãã°ãC<Wide character in ...> +ãåãã¦æ»ã«ã¾ãã + +=head3 C<< $furl->get($url :Str, $headers :ArrayRef[Str] ) >> + +=begin original + +This is an easy-to-use alias to C<request()>, sending the C<GET> method. + +=end original + +C<request()>ç°¡åã«ä½¿ãããã®ã¨ã¤ãªã¢ã¹ã§ããC<GET>ã¡ã½ãããéãã¾ãã + +=head3 C<< $furl->head($url :Str, $headers :ArrayRef[Str] ) >> + +=begin original + +This is an easy-to-use alias to C<request()>, sending the C<HEAD> method. + +=end original + +C<request()>ç°¡åã«ä½¿ãããã®ã¨ã¤ãªã¢ã¹ã§ããC<HED>ã¡ã½ãããéãã¾ãã + +=head3 C<< $furl->post($url :Str, $headers :ArrayRef[Str], $content :Any) >> + +=begin original + +This is an easy-to-use alias to C<request()>, sending the C<POST> method. + +=end original + +C<request()>ç°¡åã«ä½¿ãããã®ã¨ã¤ãªã¢ã¹ã§ããC<POST>ã¡ã½ãããéãã¾ãã + +=head3 C<< $furl->put($url :Str, $headers :ArrayRef[Str], $content :Any) >> + +=begin original + +This is an easy-to-use alias to C<request()>, sending the C<PUT> method. + +=end original + +C<request()>ç°¡åã«ä½¿ãããã®ã¨ã¤ãªã¢ã¹ã§ããC<PUT>ã¡ã½ãããéãã¾ãã + +=head3 C<< $furl->delete($url :Str, $headers :ArrayRef[Str] ) >> + +=begin original + +This is an easy-to-use alias to C<request()>, sending the C<DELETE> method. + +=end original + +C<request()>ç°¡åã«ä½¿ãããã®ã¨ã¤ãªã¢ã¹ã§ããC<DELETE>ã¡ã½ãããéãã¾ãã + +=head1 FAQ + +=over 4 + +=item ã©ãã㦠IO::Socket::SSL? + +=begin original + +=item Why IO::Socket::SSL? + +=end original + +=begin original + +Net::SSL is not well documented. + +=end original + +Net::SSL ã¯ããã¥ã¡ã³ãã貧弱ã§ãã + +=begin original + +=item Why is env_proxy optional? + +=end original + +=item env_proxy ã¯ãªããªãã·ã§ãã«ãªã®ã§ãã? + +=begin original + +Environment variables are highly dependent on each users' environment, +and we think it may confuse users when something doesn't go right. + +=end original + +ç°å¢å¤æ°ã¯ã¦ã¼ã¶ã¼ã®ç°å¢ã«å¼·ãä¾åãã¾ãã +ãã¾ãåããªãã¨ãã«ã¦ã¼ã¶ã¼ãæ··ä¹±ããã¾ãã + +=begin original + +=item What operating systems are supported? + +=end original + +=item ã©ã®ãªãã¬ã¼ãã£ã³ã°ã·ã¹ãã ããµãã¼ããã¾ãã? + +=begin original + +Linux 2.6 or higher, OSX Tiger or higher, Windows XP or higher. + +=end original + +Linux 2.6 以ä¸ã OSX Tiger 以ä¸ã Windows XP 以ä¸ã + +=begin original + +And other operating systems will be supported if you send a patch. + +=end original + +ããªããããããéãã°ãä»ã®ãªãã¬ã¼ãã£ã³ã°ã·ã¹ãã ããµãã¼ããããã§ãããã + +=begin original + +=item Why doesn't Furl support chunked upload? + +=end original + +=item ãªãFurlã¯ãã£ã³ã¯ãããã¢ãããã¼ãããµãã¼ãããªãã®ã§ãã? + +=begin original + +There are reasons why chunked POST/PUTs should not be used in general. + +=end original + +ä¸è¬çã«ããã£ã³ã¯ãããPOST/PUTããªã使ãã¹ãã§ã¯ãªããã¨ããçç±ãããã¾ãã + +=begin original + +First, you cannot send chunked requests unless the peer server at the other end of the established TCP connection is known to be a HTTP/1.1 server. + +=end original + +ã¾ãã確ç«ãããTCPã®æ¥ç¶ã®ããä¸æ¹ã®çµç«¯ã®ãã¢ãµã¼ããHTTP/1.1ã®ãµã¼ãã¨ããã£ã¦ããªããã°ããã£ã³ã¯ããããªã¯ã¨ã¹ããéããã¨ãã§ãã¾ããã + +=begin original + +Second, HTTP/1.1 servers disconnect their persistent connection quite quickly (compared to the time they wait for the first request), so it is not a good idea to post non-idempotent requests (e.g. POST, PUT, etc.) as a succeeding request over persistent connections. + +=end original + +次ã«ãHTTP/1.1ã®ãµã¼ãã¯æ°¸ç¶çãªæ¥ç¶ãé常ã«éãåæãã¾ã(æåã®ãªã¯ã¨ã¹ããå¾ ã¤æéã«æ¯ã¹ã¦)ã +ãã®ãããæ°¸ç¶çãªæ¥ç¶è¶ãã«ãé£ç¶ãããªã¯ã¨ã¹ãã¨ãã¦ä¸å¤ã§ãªããªã¯ã¨ã¹ã(ä¾ POST,PUTãªã©)ããã¹ãããã®ã¯è¯ãããã¾ããã + +=begin original + +These facts together makes using chunked requests virtually impossible (unless you _know_ that the server supports HTTP/1.1), and this is why we decided that supporting the feature is NOT of high priority. + +=end original + +These facts together makes using chunked requests virtually impossible (unless you _know_ that the server supports HTTP/1.1), and this is why we decided that supporting the feature is NOT of high priority. + +=begin original + +=item How do you build the response content as it arrives? + +=end original + +=item å°éããã¬ã¹ãã³ã¹ã®å 容ãã©ã®ããã«ä½ãã¾ãã? + +=begin original + +You can use L<IO::Callback> for this purpose. + +=end original + +ãã®ããã«L<IO::Callback>ã使ãã¾ãã + + my $fh = IO::Callback->new( + '<', + sub { + my $x = shift @data; + $x ? "-$x" : undef; + } + ); + my ( $code, $msg, $headers, $content ) = + $furl->put( "http://127.0.0.1:$port/", [ 'Content-Length' => $len ], $fh, + ); + +=begin original + +=item How do you use gzip/deflate compressed communication? + +=end original + +=item gzip/deflate å§ç¸®ãããã³ãã¥ãã±ã¼ã·ã§ã³ã使ãã¾ãã? + +=begin original + +Add an B<Accept-Encoding> header to your request. Furl inflates response bodies transparently according to the B<Content-Encoding> response header. + +=end original + +B<Accept-Encoding>ãããããªã¯ã¨ã¹ãã«è¿½å ãã¦ãã ãããFurlã¬ã¹ãã³ã¹ããã£ã¼ãB<Content-Encoding>ã¬ã¹ãã³ã¹ãããã«å¾ã£ã¦ééçã«ã¤ã³ãã¬ã¼ããã¾ãã + +=begin original + +=item How do you use mutipart/form-data? + +=end original + +=item mutipart/form-data ã使ãã«ã¯? + +=begin original + +You can use multipart/form-data with L<HTTP::Request::Common>. + +=end original + +L<HTTP::Request::Common>ã使ã£ã¦ãmultipart/form-dataã使ãã¾ãã + + use HTTP::Request::Common; + + my $furl = Furl->new(); + $req = POST 'http://www.perl.org/survey.cgi', + Content_Type => 'form-data', + Content => [ + name => 'Hiromu Tokunaga', + email => 'tokuh****@examp*****', + gender => 'F', + born => '1978', + init => ["$ENV{HOME}/.profile"], + ]; + $furl->request($req); + +=begin original + +Native multipart/form-data support for L<Furl> is available if you can send a patch for me. + +=end original + +ããããéããã¨ãã§ãããªããL<Furl>ã§ãã¤ãã£ãã®multipart/form-dataãµãã¼ãã¯å©ç¨å¯è½ã§ãã + +=begin original + +=item How do you use Keep-Alive and what happens on the HEAD method? + +=end original + +=item Kee-Alive ãã©ããã£ã¦ä½¿ãã®ãã¨HEADã¡ã½ããã§ã¯ä½ãèµ·ããã®ã? + +=begin original + +Furl supports HTTP/1.1, hence C<Keep-Alive>. However, if you use the HEAD +method, the connection is closed immediately. + +=end original + +Furlã¯HTTP/1.1ããµãã¼ããã¾ããå¾ã£ã¦ãC<Keep-Alive>ããµãã¼ããã¾ãã +ã§ãããHEADã¡ã½ããã§ä½¿ã£ã¦ããæ¥ç¶ã¯å³åº§ã«åæããã¾ãã + +=begin original + +RFC 2616 section 9.4 says: + +=end original + +RFC 2616 section 9.4 ã«ããã¨: + +=begin original + + The HEAD method is identical to GET except that the server MUST NOT + return a message-body in the response. + +=end original + + HEADã¡ã½ããã¯ããµã¼ããã¬ã¹ãã³ã¹ã«ã¡ãã»ã¼ã¸ããã£ãè¿ããã¦ã¯ãããªããã¨ã + é¤ãã¦ãGETã¡ã½ããã¨åä¸ã§ãã + +=begin original + +Some web applications, however, returns message bodies on the HEAD method, +which might confuse C<Keep-Alive> processes, so Furl closes connection in +such cases. + +=end original + +ã§ããWebã¢ããªã±ã¼ã·ã§ã³ã«ãã£ã¦ã¯ãHEADã¡ã½ããã§ã¡ãã»ã¼ã¸ããã£ã +è¿ããã¨ãããã¾ãããC<Kee-Alive>ããã»ã¹ãæ··ä¹±ããã¾ãããã®ããFurl +ã¯ãã®ãããªã±ã¼ã¹ã§ã¯æ¥ç¶ãéãã¾ãã + +=begin original + +Anyway, the HEAD method is not so useful nowadays. The GET method and +C<If-Modified-Sinse> are more suitable to cache HTTP contents. + +=end original + +ãããã«ãããHEADã¡ã½ããã¯ãä»æ¥ã§ã¯ããããªã«æç¨ã§ã¯ããã¾ãããGETã¡ã½ãã㨠+C<If-Modified-Sinse>ã®ã»ããHTTPã³ã³ãã³ãããã£ãã·ã¥ããã®ã«åã£ã¦ãã¾ãã + +=begin original + +=item Why does Furl take longer than specified until it returns a timeout error? + +=end original + +=item Why does Furl take longer than specified until it returns a timeout error? + +ãªãFurlã¯ã¿ã¤ã ã¢ã¦ãã¨ã©ã¼ãè¿ãã¾ã§æå®ããé·ããããã®ã§ãã? + +=begin original + +Although Furl itself supports timeout, some underlying modules / functions do not. And the most noticeable one is L<Socket::inet_aton>, the function used for name resolution (a function that converts hostnames to IP addresses). If you need accurate and short timeout for name resolution, the use of L<Net::DNS::Lite> is recommended. The following code snippet describes how to use the module in conjunction with Furl. + +=end original + +Furlèªèº«ã¯ã¿ã¤ã ã¢ã¦ãããµãã¼ããã¾ãããåºç¤çãªã¢ã¸ã¥ã¼ã«ãé¢æ°ã¯ãµãã¼ããã¾ããããã£ã¨ãé¡èãªä¾ã¨ãã¦ã¯ãL<Socket::inet_aton>ã§ãããã®é¢æ°ã¯åå解決(ãã¹ããã¼ã ããIPã¢ãã¬ã¹ã¸ã®å¤æ)ã«ä½¿ããã¦ãã¾ãã +ããåå解決ã«æ£ç¢ºã§çããã¿ã¤ã ã¢ã¦ããå¿ è¦ãªããL<Net::DNS::Lite>ããå§ããã¾ããä¸è¨ã®ã³ã¼ãã¹ããããã¯ãFurlã§ã©ã®ããã«ä½¿ããã説æãã¦ãã¾ãã + + use Net::DNS::Lite qw(); + + my $furl = Furl->new( + timeout => $my_timeout_in_seconds, + inet_aton => sub { Net::DNS::Lite::inet_aton(@_) }, + ); + +=back + +=head1 TODO + + - AnyEvent::Furl? + - ipv6 support + - better docs for NO_PROXY + +=head1 ãªãã·ã§ãã«ãªæ©è½ + +=begin original + +=head2 Internationalized Domain Name (IDN) + +=end original + +=head2 å½éãã¡ã¤ã³å(IDN) + +=begin original + +This feature requires Net::IDN::Encode. + +=end original + +ãã®æ©è½ã¯ Net::IDN::Encode ãå¿ è¦ã§ãã + +=head2 SSL + +=begin original + +This feature requires IO::Socket::SSL. + +=end original + +ãã®æ©è½ã¯ IO::Socket::SSL ãå¿ è¦ã§ãã + +=head2 Content-Encoding (deflate, gzip) + +=begin original + +This feature requires Compress::Raw::Zlib. + +=end original + +ãã®æ©è½ã¯ Compress::Raw::Zlib ãå¿ è¦ã§ãã + +=head1 éçº + +=begin original + +To setup your environment: + +=end original + +ç°å¢ã®ã»ããã¢ãã: + + $ git clone http://github.com/tokuhirom/p5-Furl.git + $ cd p5-Furl + +=begin original + +To get picohttpparser: + +=end original + +picohttpparser ã®åå¾: + + $ git submodule init + $ git submodule update + + $ perl Makefile.PL + $ make + $ sudo make install + +=head2 è²¢ç®ããã«ã¯ + +Please send the pull-req via L<http://github.com/tokuhirom/p5-Furl/>. + +=head1 åç § + +L<LWP> + +HTTP specs: +L<http://www.w3.org/Protocols/HTTP/1.0/spec.html> +L<http://www.w3.org/Protocols/HTTP/1.1/spec.html> + +=head1 LICENSE + +Copyright (C) Tokuhiro Matsuno. + +This library is free software; you can redistribute it and/or modify +it under the same terms as Perl itself. + + +=cut + Index: docs/modules/Furl-0.24/lib/Furl/Headers.pod diff -u /dev/null docs/modules/Furl-0.24/lib/Furl/Headers.pod:1.1 --- /dev/null Thu Feb 10 11:33:30 2011 +++ docs/modules/Furl-0.24/lib/Furl/Headers.pod Thu Feb 10 11:33:30 2011 @@ -0,0 +1,156 @@ +=encoding utf8 + +=head1 åå + +=begin original + +Furl::Headers - HTTP Headers object + +=end original + +Furl::Headers - HTTPãããã¼ãªãã¸ã§ã¯ã + +=head1 æ¦è¦ + +=head1 ã³ã³ã¹ãã©ã¯ã¿ + +=over 4 + +=item my $headers = Furl::Headers->new(\%headers); + +=begin original + +The constructor takes one argument. It is a hashref. +Every key of hashref must be lower-cased. + +=end original + +ã³ã³ã¹ãã©ã¯ã¿ã¯ããã·ã¥ãªãã¡ã¬ã³ã¹ã®å¼æ°ãä¸ã¤ã¨ãã¾ãã +ããã·ã¥ãªãã¡ã¬ã³ã¹ã®ãã¹ã¦ã®ãã¼ã¯å°æåã§ãªããã°ããã¾ããã + +=begin original + +The format of the argument is like following: + +=end original + +å¼æ°ã®ãã©ã¼ãããã¯ä»¥ä¸ã®ããã«ãªãã¾ã: + + +{ + 'content-length' => [30], + 'set-cookies' => ['auth_token=; path=/; expires=Thu, 01 Jan 1970 00:00:00 GMT', '_twitter_sess=JKLJBNBLKSFJBLKSJBLKSJLKJFLSDJFjkDKFUFIOSDUFSDVjOTUzNzUwNTE2%250AZWFiMWRiNDZhMDcwOWEwMWQ5IgpmbGFzaElDOidBY3Rpb25Db250cm9sbGVy%250AOjpGbGFzaDo6Rmxhc2hIYXNoewAGOgpAdXNlZHsA--d9ce07496a22525bc178jlkhafklsdjflajfl411; domain=.twitter.com; path=/'], + } + +=back + +=head1 ã¤ã³ã¹ã¿ã³ã¹ã¡ã½ãã + +=over 4 + +=item my @values = $headers->header($key); + +=begin original + +Get the header value in array. + +=end original + +é åã§ãããã®å¤ãããã¨ãã¾ãã + +=item my $values_joined = $headers->header($key); + +=begin original + +Get the header value in scalar. This is not a first value of header. This is same as: + +=end original + +ã¹ã«ã©ã§ãããã®å¤ãããã¨ãã¾ããããã¯ãããã®åãã®å¤ã§ã¯ããã¾ããã次ã®ãã®ã¨åãã§ã: + + my $values = join(", ", $headers->header($key)) + +=item $headers->header($key, $val); + +=item $headers->header($key, \@val); + +=begin original + +Set the new value of headers. + +=end original + +ãããã«æ°ããå¤ãã»ãããã¾ãï¼ + +=item $headers->remove_header($key); + +=begin original + +Delete key from headers. + +=end original + +ãããããå¤ãåé¤ãã¾ãã + +=item my @h = $headers->flatten(); + +=begin original + +Gets pairs of keys and values. + +=end original + +ãã¼ã¨å¤ã®ãã¢ãå¾ã¾ãã + +=item my @keys = $headers->keys(); + +=item my @keys = $headers->header_field_names(); + +=begin original + +Returns keys of headers in array. The return value do not contains duplicated value. + +=end original + +é åã§ãããã®ãã¼ãè¿ãã¾ããè¿ãå¤ã¯éè¤ããå¤ãè¿ãã¾ããã + +=item my $str = $headers->as_string(); + +=begin original + +Return the header fields as a formatted MIME header. + +=end original + +æ´å½¢æ¸ã¿ã®MIMEãããã¨ãã¦ããããã£ã¼ã«ããè¿ãã¾ãã + +=item my $val = $headers->referer() + +=item my $val = $headers->expires() + +=item my $val = $headers->last_modified() + +=item my $val = $headers->if_modified_since() + +=item my $val = $headers->content_type() + +=item my $val = $headers->content_length() + +=item my $val = $headers->content_encoding() + +=begin original + +These methods are shortcut for popular headers. + +=end original + +ãããã®ã¡ã½ããã¯ããã¥ã©ã¼ãªãããã®ããã®ã·ã§ã¼ãã«ããã§ãã + +=back + +=head1 åç § + +L<HTTP::Headers> + + +=cut + Index: docs/modules/Furl-0.24/lib/Furl/Response.pod diff -u /dev/null docs/modules/Furl-0.24/lib/Furl/Response.pod:1.1 --- /dev/null Thu Feb 10 11:33:30 2011 +++ docs/modules/Furl-0.24/lib/Furl/Response.pod Thu Feb 10 11:33:30 2011 @@ -0,0 +1,130 @@ +=encoding utf8 + +=head1 æ¦è¦ + + my $res = Furl::Response->new($minor_version, $code, $message, $headers, $content); + print $res->status, "\n"; + +=head1 説æ + +=begin original + +This is a HTTP response object in Furl. + +=end original + +ããã¯Furl ã® HTTPã¬ã¹ãã³ã¹ãªãã¸ã§ã¯ãã§ãã + +=head1 ã³ã³ã¹ãã©ã¯ã¿ + + my $res = Furl::Response->new($minor_version, $code, $msg, \%headers, $content); + +=head1 ã¤ã³ã¹ã¿ã³ã¹ã¡ã½ãã + +=over 4 + +=item $res->code + +=item $res->status + +=begin original + +Returns HTTP status code. + +=end original + +HTTPã¹ãã¼ã¿ã¹ã³ã¼ããè¿ãã¾ãã + +=item $res->message + +=begin original + +Returns HTTP status message. + +=end original + +HTTPã¹ãã¼ã¿ã¹ã¡ãã»ã¼ã¸ãè¿ãã¾ãã + +=item $res->headers + +=begin original + +Returns instance of L<Furl::Headers> + +=end original + +L<Furl::Headers>ã®ã¤ã³ã¹ã¿ã³ã¹ãè¿ãã¾ãã + +=item $res->content + +=item $res->body + +=begin original + +Returns response body in scalar. + +=end original + +ã¬ã¹ãã³ã¹ããã£ã¼ãã¹ã«ã©ã§è¿ãã¾ãã + +=item $res->content_length + +=item $res->content_type + +=item $res->content_encoding + +=item $res->header + +=begin original + +Shorthand to access L<Furl::Headers>. + +=end original + +L<Furl::Headers>ã¸ã¢ã¯ã»ã¹ããããã®ã·ã§ã¼ããã³ãã§ãã + +=item $res->protocol + + $res->protocol(); # => "HTTP/1.1" + +=begin original + +Returns HTTP protocol in string. + +=end original + +HTTP ãããã³ã«ãæååã§è¿ãã¾ãã + +=item $res->as_http_response + +=begin original + +Make instance of L<HTTP::Response> from L<Furl::Response>. + +=end original + +L<Furl::Response>ããL<HTTP::Response>ã®ã¤ã³ã¹ã¿ã³ã¹ãä½ãã¾ãã + +=item $res->is_success + +=begin original + +Returns true if status code is 2xx. + +=end original + +ã¹ãã¼ã¿ã¹ã³ã¼ãã2xxã§ããã°ãçãè¿ãã¾ãã + +=item $res->status_line + + $res->status_line() # => "200 OK" + +=begin original + +Returns status line. + +=end original + +ã¹ãã¼ã¿ã¹ã©ã¤ã³ãè¿ãã¾ãã + +=back