cvs: peardoc /ja/package/http http-request.xml /ja/package/http/http-request basic-auth.xml cookie.xml file-upload.xml headers.xml intro.xml
proxy-auth.xml response-eval.xml
| From: | Tadashi Jokagi | Date: | Sun, 03 Oct 2004 15:14:50 +0000 |
| Subject: | cvs: peardoc /ja/package/http http-request.xml /ja/package/http/http-request basic-auth.xml cookie.xml file-upload.xml headers.xml intro.xml proxy-auth.xml response-eval.xml |
||
| Groups: | php.pear.doc | ||
| Request: | Send a blank email to pear-doc+get-4931@lists.php.net to get a copy of this message | ||
elf Sun Oct 3 11:14:50 2004 EDT
Added files:
/peardoc/ja/package/http http-request.xml
/peardoc/ja/package/http/http-request basic-auth.xml cookie.xml
file-upload.xml headers.xml
intro.xml proxy-auth.xml
response-eval.xml
Log:
o added japanese manual (thanks shimooka)
http://cvs.php.net/co.php/peardoc/ja/package/http/http-request.xml?r=1.1&p=1 Index: peardoc/ja/package/http/http-request.xml +++ peardoc/ja/package/http/http-request.xml <?xml version="1.0" encoding="utf-8" ?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.2 Maintainer: shimooka Status: ready --> <sect1 id="package.http.http-request"> <title>HTTP_Request</title> <para> ãã®ããã±ã¼ã¸ã¯ãHTTP ãªã¯ã¨ã¹ããå®è¡ããããã®ç°¡åãªæ¹æ³ãæä¾ãã¾ãã GET/POST/HEAD/TRACE/PUT/DELETEãBasicèªè¨¼ããããã·ããããã·èªè¨¼ãSSLã ãã¡ã¤ã«ã¢ãããã¼ããªã©ããµãã¼ããã¾ãã </para> &package.http.http-request.intro; &package.http.http-request.basic-auth; &package.http.http-request.cookie; &package.http.http-request.file-upload; &package.http.http-request.headers; &package.http.http-request.proxy-auth; &package.http.http-request.response-eval; </sect1> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/co.php/peardoc/ja/package/http/http-request/basic-auth.xml?r=1.1&p=1 Index: peardoc/ja/package/http/http-request/basic-auth.xml +++ peardoc/ja/package/http/http-request/basic-auth.xml <?xml version="1.0" encoding="utf-8" ?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.1 Maintainer: shimooka Status: ready --> <refentry id="package.http.http-request.basic-auth"> <refnamediv> <refname>Basic èªè¨¼</refname> <refpurpose> ä¿è·ããã Web ãµã¤ãã®ããã®èªè¨¼ </refpurpose> </refnamediv> <refsect1 id="package.http.http-request.basic-auth.intro"> <title>Basic èªè¨¼å°å ¥</title> <titleabbrev>å°å ¥</titleabbrev> <para> Basic èªè¨¼ã¯ã<ulink url="&url.rfc;2617">RFC 2617</ulink> ã§å®ç¾©ããããã£ã¬ã³ã¸-ã¬ã¹ãã³ã¹ã¡ã«ããºã ã§ãã </para> </refsect1> <refsect1 id="package.http.http-request.basic-auth.usage"> <title>Basic èªè¨¼ã®ä½¿ç¨æ¹æ³</title> <example> <title>Basic èªè¨¼</title> <para> 以ä¸ã®ä¾ã¯ãBasic èªè¨¼ã§ä¿è·ããããã¹ã <literal>example.com</literal> ã«ããã¨ãããã¼ã¸ <filename>/protected.html</filename> ãåå¾ãããã¨ãã¦ãããã¨æ³å®ãã¦ãã¾ãã èªè¨¼ããã¹ããããã«å¿ è¦ãªã¦ã¼ã¶ã¼å㯠<literal>johndoe</literal> ã§ã ä»éãããã¹ã¯ã¼ã㯠<literal>foo</literal> ã§ãã </para> <programlisting role="php"> require_once "HTTP/Request.php"; $req =& new HTTP_Request("http://example.com/protected.html"); $req->setBasicAuth("johndoe", "foo"); $response = $req->sendRequest(); if (PEAR::isError($response)) { echo $response->getMessage(); } else { echo $req->getResponseBody(); } </programlisting> </example> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/co.php/peardoc/ja/package/http/http-request/cookie.xml?r=1.1&p=1 Index: peardoc/ja/package/http/http-request/cookie.xml +++ peardoc/ja/package/http/http-request/cookie.xml <?xml version="1.0" encoding="utf-8" ?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.2 Maintainer: shimooka Status: ready --> <refentry id="package.http.http-request.cookie"> <refnamediv> <refname>ã¯ããã¼</refname> <refpurpose> <classname>HTTP_Request</classname> ã§ã¯ããã¼ãå©ç¨ãã </refpurpose> </refnamediv> <refsect1 id="package.http.http-request.cookie.usage.add"> <title>HTTP ãªã¯ã¨ã¹ãã¸ã®ã¯ããã¼ã®è¿½å æ¹æ³</title> <example> <title>ãªã¯ã¨ã¹ãã«ã¯ããã¼ã追å ãã</title> <para> ãã®ä¾ã§ã¯ã<literal>version</literal> ã¨ããã¯ããã¼ã HTTP ãªã¯ã¨ã¹ãã«è¿½å ããã¾ãããã®ã¯ããã¼ã®å¤ã¯ã <classname>HTTP_Request</classname> ã¤ã³ã¹ã¿ã³ã¹ãåä½ãã¦ãã PHP ã¤ã³ã¿ããªã¿ã®ãã¼ã¸ã§ã³æååã§ãã </para> <programlisting role="php"> require_once "HTTP/Request.php"; $req =& new HTTP_Request("http://example.com/"); $req->addCookie("version", phpversion()); $response = $req->sendRequest(); if (PEAR::isError($response)) { echo $response->getMessage(); } else { echo $req->getResponseBody(); } </programlisting> </example> <example> <title>HTTP ã¬ã¹ãã³ã¹ããã¯ããã¼ãèªã¿è¾¼ã</title> <para> HTTP ã¬ã¹ãã³ã¹ã®ã¯ããã¼ãèªã¿è¾¼ã¿ã¯ã以ä¸ã®ä¾ã§ç¤ºããã¾ãã </para> <programlisting role="php"> require_once "HTTP/Request.php"; $req =& new HTTP_Request("http://example.com/"); $response = $req->sendRequest(); if (PEAR::isError($response)) { echo $response->getMessage(); } else { print_r($req->getResponseCookies()); } </programlisting> </example> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/co.php/peardoc/ja/package/http/http-request/file-upload.xml?r=1.1&p=1 Index: peardoc/ja/package/http/http-request/file-upload.xml +++ peardoc/ja/package/http/http-request/file-upload.xml <?xml version="1.0" encoding="utf-8" ?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.1 Maintainer: shimooka Status: ready --> <refentry id="package.http.http-request.file-upload"> <refnamediv> <refname>ãã¡ã¤ã«ã¢ãããã¼ã</refname> <refpurpose> HTTP çµç±ã§ãã¡ã¤ã«ãã¢ãããã¼ããã </refpurpose> </refnamediv> <refsect1 id="package.http.http-request.file-upload.usage"> <title>ãã¡ã¤ã«ã¢ãããã¼ãã®ä½¿ç¨æ¹æ³</title> <example> <title>PDF æç« ãã¢ãããã¼ããã</title> <para> ãã®ä¾ã§ã¯ã<filename>/home/johndoe/text.pdf</filename> ã¨ãããã¡ã¤ã«ã ãªã¢ã¼ãã«ãããã·ã³ <literal>upload.example.com</literal> ã« <literal>johndoe-text.pdf</literal> ã¨ããååã§ã¢ãããã¼ãããã¾ãã ããã«ãã¸ã§ã³ãä½ããã¢ãããã¼ãããäºã許å¯ããã¦ãããã¨ã ä¿è¨¼ããããã«ãBasic èªè¨¼ã使ç¨ããã¦ãã¾ãã </para> <programlisting role="php"> require_once "HTTP/Request.php"; $req =& new HTTP_Request("http://upload.example.com/upload.php"); $req->setBasicAuth("johndoe", "foo"); $result = $req->addFile("johndoe-txt.pdf", "/home/johndoe/text.pdf"); if (PEAR::isError($result)) { echo $result->getMessage(); } else { $response = $req->sendRequest(); if (PEAR::isError($response)) { echo $response->getMessage(); } else { echo $req->getResponseBody(); } } </programlisting> </example> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/co.php/peardoc/ja/package/http/http-request/headers.xml?r=1.1&p=1 Index: peardoc/ja/package/http/http-request/headers.xml +++ peardoc/ja/package/http/http-request/headers.xml <?xml version="1.0" encoding="utf-8" ?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.1 Maintainer: shimooka Status: ready --> <refentry id="package.http.http-request.headers"> <refnamediv> <refname>ãªã¯ã¨ã¹ãããã</refname> <refpurpose> HTTP ãªã¯ã¨ã¹ãã«ä»å çãªã®ãããã追å ãã </refpurpose> </refnamediv> <refsect1 id="package.http.http-request.headers.usage"> <title>ãªã¯ã¨ã¹ããããã®è¿½å æ¹æ³</title> <example> <title>ã«ã¹ã¿ã ãªã¯ã¨ã¹ããããã®è¿½å </title> <para> 以ä¸ã®ä¾ã§ã¯ãHTTP ããã <literal>X-PHP-Version</literal> ã HTTP ãªã¯ã¨ã¹ãã«è¿½å ããã¾ãããã®ãããã®å¤ã¯ã <classname>HTTP_Request</classname> ã¤ã³ã¹ã¿ã³ã¹ãåä½ãã¦ãã PHP ã¤ã³ã¿ããªã¿ã®ãã¼ã¸ã§ã³æååã§ãã </para> <programlisting role="php"> require_once "HTTP/Request.php"; $req =& new HTTP_Request("http://example.com/"); $req->addHeader("X-PHP-Version", phpversion()); $response = $req->sendRequest(); if (PEAR::isError($response)) { echo $response->getMessage(); } else { echo $req->getResponseBody(); } </programlisting> </example> <para> <classname>HTTP_Request</classname> ãªãã¸ã§ã¯ãã«è¿½å ããããããã¯ã <function>sendRequest</function> ãã³ã¼ã«ãããåã« <function>removeHeader</function> ã§åé¤ãããã¨ãã§ãã¾ãã </para> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/co.php/peardoc/ja/package/http/http-request/intro.xml?r=1.1&p=1 Index: peardoc/ja/package/http/http-request/intro.xml +++ peardoc/ja/package/http/http-request/intro.xml <?xml version="1.0" encoding="utf-8" ?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.2 Maintainer: shimooka Status: ready --> <refentry id="package.http.http-request.intro"> <refnamediv> <refname>å°å ¥</refname> <refpurpose> <classname>HTTP_Request</classname> å°å ¥ </refpurpose> </refnamediv> <refsect1 id="package.http.http-request.intro.overview"> <title>æ¦è¦</title> <para> ãã®ããã±ã¼ã¸ã使ç¨ãããã¨ã§ã<acronym>PHP</acronym> ã¹ã¯ãªãããã HTTP ãªã¯ã¨ã¹ããç°¡åã«å¦çãããã¨ãã§ãã¾ãã ããã¯ãGET/POST/HEAD/TRACE/PUT/DELETEãBasic èªè¨¼ããããã·ã ãããã·èªè¨¼ãSSLããã¡ã¤ã«ã¢ãããã¼ããªã©ããµãã¼ããã¦ãã¾ãã </para> <para> åè¿°ã®ç¹é·ã®ããã<classname>HTTP_Request</classname> 㯠PHP ã¢ããªã±ã¼ã·ã§ã³ã§åºãç¥ããã Mozilla ãã©ã¦ã¶ã®ãã㪠Web ãã©ã¦ã¶ã®ã»ã¨ãã©ã®æ©è½ã模å£ãããã¨ãå¯è½ã«ãã¾ãã å¯è½ãªã¢ããªã±ã¼ã·ã§ã³ç¯å²ã¯ã次ã®éãã§ã: <itemizedlist> <listitem> <simpara> <function><link linkend="package.http.http-request.response-eval.codes">getResponseCode</link></function> ã®å©ãã«ãã WWW ãªã³ã¯ã®æå¹æ§ããã§ãã¯ããã㨠</simpara> </listitem> <listitem> <simpara> ãªã¢ã¼ãã® Web ãã¼ã¸ãåãè¾¼ã¿ãçµæããã¼ã¹ããã㨠</simpara> </listitem> <listitem> <simpara> ãã®ä» </simpara> </listitem> </itemizedlist> </para> </refsect1> <refsect1 id="package.http.http-request.intro.examples"> <title>ããã¤ãã®ä¾</title> <example> <title> <ulink url="http://yahoo.com/">yahoo.com</ulink> ã®å 容ãåå¾ãã ããã表示ãã </title> <programlisting role="php"> require_once "HTTP/Request.php"; $req =& new HTTP_Request("http://www.yahoo.com/"); if (!PEAR::isError($req->sendRequest())) { echo $req->getResponseBody(); } </programlisting> </example> <example> <title>äºã¤ã® Web ãµã¤ãã®å 容ãåå¾ããä¸è¡ã§è¡¨ç¤ºãã</title> <para> ãã®ä¾ã§ã¯ãäºã¤ã® Web ãµã¤ãã®å 容ãåå¾ããã表示ããã¾ãã åè 㯠POST ãã©ã¡ã¼ã¿ãå¦çããã¾ããPOST ãã¼ã¿ã¹ã¿ãã¯ã¯ã äºçªç®ã® Web ãµã¤ãã®å 容ãåå¾ãããåã«ã¯ãªã¢ããã¾ãã </para> <programlisting role="php"> require_once "HTTP/Request.php"; $req =& new HTTP_Request("http://www.php.net"); $req->setMethod(HTTP_REQUEST_METHOD_POST); $req->addPostData("Foo", "bar"); if (!PEAR::isError($req->sendRequest())) { $response1 = $req->getResponseBody(); } else { $response1 = ""; } $req->setMethod(HTTP_REQUEST_METHOD_GET); $req->setURL("http://pear.php.net"); $req->clearPostData(); if (!PEAR::isError($req->sendRequest())) { $response2 = $req->getResponseBody(); } else { $response2 = ""; } echo $response1; echo $response2; </programlisting> </example> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/co.php/peardoc/ja/package/http/http-request/proxy-auth.xml?r=1.1&p=1 Index: peardoc/ja/package/http/http-request/proxy-auth.xml +++ peardoc/ja/package/http/http-request/proxy-auth.xml <?xml version="1.0" encoding="utf-8" ?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.1 Maintainer: shimooka Status: ready --> <refentry id="package.http.http-request.proxy-auth"> <refnamediv> <refname>ãããã·èªè¨¼</refname> <refpurpose> HTTP ãããã·ãå©ç¨ãã </refpurpose> </refnamediv> <refsect1 id="package.http.http-request.proxy-auth.usage"> <title>ãããã·èªè¨¼ã®ä½¿ç¨æ¹æ³</title> <example> <title>å¿åã¢ã¯ã»ã¹ã§ãããã·ãµã¼ããå©ç¨ãã</title> <para> ãã®ä¾ã§ã¯ããããã·ãµã¼ãããã¼ã <literal>8080</literal> ã§å¾ æ©ãã¦ããã example.com ã¸ã®å¤åãæ¥ç¶ã®ä»£çï¼ãããã·ï¼ãè¡ã£ã¦ãã <literal>proxy.example.com</literal> ã¨ãããã¹ãåã®ãã·ã³ã å©ç¨ãããã¨ãã¦ãããã¨æ³å®ãã¦ãã¾ãã </para> <para> <function>setProxy</function> ã®äºçªç®ã®ãã©ã¡ã¼ã¿ã¯ãªãã·ã§ã³ã§ã ããã©ã«ã㯠<literal>8080</literal> ã§ãã </para> <programlisting role="php"> require_once "HTTP/Request.php"; $req =& new HTTP_Request("http://example.com/"); $req->setProxy("proxy.example.com", 8080); </programlisting> </example> <example> <title>ãããã·èªè¨¼ã®å©ç¨</title> <para> ããã¯ããããã·ãµã¼ãã§ã®ã¦ã¼ã¶ã¼èªè¨¼ã®ããã®ã¦ã¼ã¶ã¼å/ãã¹ã¯ã¼ãã® ã¿ãã«ãæä¾ããã¦ãããã¨ãé¤ãã¦ãä¸è¨ã¨åãä¾ã§ã: ã¦ã¼ã¶ã¼å㯠<literal>johndoe</literal> ã§ä»éãããã¹ã¯ã¼ã㯠<literal>foo</literal> ã§ãã </para> <programlisting role="php"> require_once "HTTP/Request.php"; $req =& new HTTP_Request("http://example.com/"); $req->setProxy("proxy.example.com", 8080, "johndoe", "foo"); </programlisting> </example> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/co.php/peardoc/ja/package/http/http-request/response-eval.xml?r=1.1&p=1 Index: peardoc/ja/package/http/http-request/response-eval.xml +++ peardoc/ja/package/http/http-request/response-eval.xml <?xml version="1.0" encoding="utf-8" ?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.1 Maintainer: shimooka Status: ready --> <refentry id="package.http.http-request.response-eval"> <refnamediv> <refname>ã¬ã¹ãã³ã¹ã®è©ä¾¡</refname> <refpurpose> HTTP ã¬ã¹ãã³ã¹ããã®æ å ±ãè©ä¾¡ãã </refpurpose> </refnamediv> <refsect1 id="package.http.http-request.response-eval.intro"> <title>å°å ¥</title> <para> HTTP 㯠<emphasis>Request - Response</emphasis> ã¹ãã¼ã ã«åºã¥ãããããã³ã«ãªã®ã§ã å ¨ã¦ã® HTTP ãªã¯ã¨ã¹ã㯠HTTP ã¬ã¹ãã³ã¹ã«è¿½éããã¾ãã <classname>HTTP_Request</classname> ã¯ã ãããã®ã¬ã¹ãã³ã¹ããã®æ å ±ãè©ä¾¡ããããã¤ãã®ã¡ã½ãããæä¾ãã¦ãã¾ãã </para> </refsect1> <refsect1 id="package.http.http-request.response-eval.codes"> <title>ã¬ã¹ãã³ã¹ã³ã¼ã</title> <para> HTTP ã¬ã¹ãã³ã¹ã®éè¦ãªé¨åã¯ãã¬ã¹ãã³ã¹ã³ã¼ãã§ãã æãè¯ãç¥ãããã¬ã¹ãã³ã¹ã³ã¼ãã¯ã ããããä½åº¦ããã©ã¦ã¶ã§è¦ããã¨ããã <literal>404</literal> ã§ãããã <literal>404</literal> ã®æå³ã¯ã ãªã¯ã¨ã¹ãããããªã½ã¼ã¹ãè¦ã¤ãããã¨ãã§ããªãã£ããã¨ãããã¨ã§ãã ã¹ãã¼ã¿ã¹ã³ã¼ãã®å®å ¨ãªãªã¹ãã¯ã <ulink url="&url.rfc;2616">RFC 2616</ulink> ã«è¦ã¤ãããã¨ãã§ãã¾ãã </para> <example> <title>ã¬ã¹ãã³ã¹ã³ã¼ãããã§ãã¯ãã</title> <programlisting role="php"> require_once "HTTP/Request.php"; $urls = array( "http://www.example.com/", "http://example.com/thisdoesnotexist.html" ); $req =& new HTTP_Request(""); foreach ($urls as $url) { $req->setURL($url); $req->sendRequest(); $code = $req->getResponseCode(); switch ($code) { case 404: echo "Document not found\n"; break; case 200: echo "Everything's ok\n"; break; /* ... */ } } </programlisting> </example> </refsect1> <refsect1 id="package.http.http-request.response-eval.header"> <title>ã¬ã¹ãã³ã¹ããã</title> <para> HTTP ãªã¯ã¨ã¹ãã¨åæ§ãHTTP ã¬ã¹ãã³ã¹ã¯ãããã¨ããã£ã§æ§æããã¾ãã <classname>HTTP_Request</classname> ã¯ã ã¬ã¹ãã³ã¹ãããã«ã¢ã¯ã»ã¹ããããã®ã¡ã½ãããæä¾ãã¾ãã </para> <example> <title>ã¬ã¹ãã³ã¹ããã®å ¨ã¦ã®ããããåå¾ãã</title> <programlisting role="php"> require_once "HTTP/Request.php"; $req =& new HTTP_Request("http://example.com/"); $req->sendRequest(); foreach ($req->getResponseHeader() as $name => $value) { echo $name . " = " . $value . "\n"; } </programlisting> <para> ããã¯ãå ¨ã¦ã®ãããã¨ä»éããå¤ã表示ãã¾ãã </para> </example> <example> <title>ç¹å®ã®ããããåå¾ãã</title> <programlisting role="php"> require_once "HTTP/Request.php"; $req =& new HTTP_Request("http://example.com/"); $req->sendRequest(); echo $req->getResponseHeader("Date"); </programlisting> <para> ããã¯ã<literal>Date:</literal> ãããã®å¤ã表示ãã¾ãã </para> </example> </refsect1> <refsect1 id="package.http.http-request.response-eval.cookies"> <title>ã¯ããã¼ã®ã¬ã¹ãã³ã¹</title> <para> HTTP ã¬ã¹ãã³ã¹ã®ä¸é¨ã§ããã¯ããã¼ãåå¾ã«ã¤ãã¦ã¯ã <link linkend="package.http.http-request.cookie">Cookies</link> ã«è¨è¼ããã¦ãã¾ãã </para> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 -->
http://cvs.php.net/co.php/peardoc/ja/package/http/http-request.xml?r=1.1&p=1 Index: peardoc/ja/package/http/http-request.xml +++ peardoc/ja/package/http/http-request.xml <?xml version="1.0" encoding="utf-8" ?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.2 Maintainer: shimooka Status: ready --> <sect1 id="package.http.http-request"> <title>HTTP_Request</title> <para> ãã®ããã±ã¼ã¸ã¯ãHTTP ãªã¯ã¨ã¹ããå®è¡ããããã®ç°¡åãªæ¹æ³ãæä¾ãã¾ãã GET/POST/HEAD/TRACE/PUT/DELETEãBasicèªè¨¼ããããã·ããããã·èªè¨¼ãSSLã ãã¡ã¤ã«ã¢ãããã¼ããªã©ããµãã¼ããã¾ãã </para> &package.http.http-request.intro; &package.http.http-request.basic-auth; &package.http.http-request.cookie; &package.http.http-request.file-upload; &package.http.http-request.headers; &package.http.http-request.proxy-auth; &package.http.http-request.response-eval; </sect1> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/co.php/peardoc/ja/package/http/http-request/basic-auth.xml?r=1.1&p=1 Index: peardoc/ja/package/http/http-request/basic-auth.xml +++ peardoc/ja/package/http/http-request/basic-auth.xml <?xml version="1.0" encoding="utf-8" ?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.1 Maintainer: shimooka Status: ready --> <refentry id="package.http.http-request.basic-auth"> <refnamediv> <refname>Basic èªè¨¼</refname> <refpurpose> ä¿è·ããã Web ãµã¤ãã®ããã®èªè¨¼ </refpurpose> </refnamediv> <refsect1 id="package.http.http-request.basic-auth.intro"> <title>Basic èªè¨¼å°å ¥</title> <titleabbrev>å°å ¥</titleabbrev> <para> Basic èªè¨¼ã¯ã<ulink url="&url.rfc;2617">RFC 2617</ulink> ã§å®ç¾©ããããã£ã¬ã³ã¸-ã¬ã¹ãã³ã¹ã¡ã«ããºã ã§ãã </para> </refsect1> <refsect1 id="package.http.http-request.basic-auth.usage"> <title>Basic èªè¨¼ã®ä½¿ç¨æ¹æ³</title> <example> <title>Basic èªè¨¼</title> <para> 以ä¸ã®ä¾ã¯ãBasic èªè¨¼ã§ä¿è·ããããã¹ã <literal>example.com</literal> ã«ããã¨ãããã¼ã¸ <filename>/protected.html</filename> ãåå¾ãããã¨ãã¦ãããã¨æ³å®ãã¦ãã¾ãã èªè¨¼ããã¹ããããã«å¿ è¦ãªã¦ã¼ã¶ã¼å㯠<literal>johndoe</literal> ã§ã ä»éãããã¹ã¯ã¼ã㯠<literal>foo</literal> ã§ãã </para> <programlisting role="php"> require_once "HTTP/Request.php"; $req =& new HTTP_Request("http://example.com/protected.html"); $req->setBasicAuth("johndoe", "foo"); $response = $req->sendRequest(); if (PEAR::isError($response)) { echo $response->getMessage(); } else { echo $req->getResponseBody(); } </programlisting> </example> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/co.php/peardoc/ja/package/http/http-request/cookie.xml?r=1.1&p=1 Index: peardoc/ja/package/http/http-request/cookie.xml +++ peardoc/ja/package/http/http-request/cookie.xml <?xml version="1.0" encoding="utf-8" ?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.2 Maintainer: shimooka Status: ready --> <refentry id="package.http.http-request.cookie"> <refnamediv> <refname>ã¯ããã¼</refname> <refpurpose> <classname>HTTP_Request</classname> ã§ã¯ããã¼ãå©ç¨ãã </refpurpose> </refnamediv> <refsect1 id="package.http.http-request.cookie.usage.add"> <title>HTTP ãªã¯ã¨ã¹ãã¸ã®ã¯ããã¼ã®è¿½å æ¹æ³</title> <example> <title>ãªã¯ã¨ã¹ãã«ã¯ããã¼ã追å ãã</title> <para> ãã®ä¾ã§ã¯ã<literal>version</literal> ã¨ããã¯ããã¼ã HTTP ãªã¯ã¨ã¹ãã«è¿½å ããã¾ãããã®ã¯ããã¼ã®å¤ã¯ã <classname>HTTP_Request</classname> ã¤ã³ã¹ã¿ã³ã¹ãåä½ãã¦ãã PHP ã¤ã³ã¿ããªã¿ã®ãã¼ã¸ã§ã³æååã§ãã </para> <programlisting role="php"> require_once "HTTP/Request.php"; $req =& new HTTP_Request("http://example.com/"); $req->addCookie("version", phpversion()); $response = $req->sendRequest(); if (PEAR::isError($response)) { echo $response->getMessage(); } else { echo $req->getResponseBody(); } </programlisting> </example> <example> <title>HTTP ã¬ã¹ãã³ã¹ããã¯ããã¼ãèªã¿è¾¼ã</title> <para> HTTP ã¬ã¹ãã³ã¹ã®ã¯ããã¼ãèªã¿è¾¼ã¿ã¯ã以ä¸ã®ä¾ã§ç¤ºããã¾ãã </para> <programlisting role="php"> require_once "HTTP/Request.php"; $req =& new HTTP_Request("http://example.com/"); $response = $req->sendRequest(); if (PEAR::isError($response)) { echo $response->getMessage(); } else { print_r($req->getResponseCookies()); } </programlisting> </example> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/co.php/peardoc/ja/package/http/http-request/file-upload.xml?r=1.1&p=1 Index: peardoc/ja/package/http/http-request/file-upload.xml +++ peardoc/ja/package/http/http-request/file-upload.xml <?xml version="1.0" encoding="utf-8" ?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.1 Maintainer: shimooka Status: ready --> <refentry id="package.http.http-request.file-upload"> <refnamediv> <refname>ãã¡ã¤ã«ã¢ãããã¼ã</refname> <refpurpose> HTTP çµç±ã§ãã¡ã¤ã«ãã¢ãããã¼ããã </refpurpose> </refnamediv> <refsect1 id="package.http.http-request.file-upload.usage"> <title>ãã¡ã¤ã«ã¢ãããã¼ãã®ä½¿ç¨æ¹æ³</title> <example> <title>PDF æç« ãã¢ãããã¼ããã</title> <para> ãã®ä¾ã§ã¯ã<filename>/home/johndoe/text.pdf</filename> ã¨ãããã¡ã¤ã«ã ãªã¢ã¼ãã«ãããã·ã³ <literal>upload.example.com</literal> ã« <literal>johndoe-text.pdf</literal> ã¨ããååã§ã¢ãããã¼ãããã¾ãã ããã«ãã¸ã§ã³ãä½ããã¢ãããã¼ãããäºã許å¯ããã¦ãããã¨ã ä¿è¨¼ããããã«ãBasic èªè¨¼ã使ç¨ããã¦ãã¾ãã </para> <programlisting role="php"> require_once "HTTP/Request.php"; $req =& new HTTP_Request("http://upload.example.com/upload.php"); $req->setBasicAuth("johndoe", "foo"); $result = $req->addFile("johndoe-txt.pdf", "/home/johndoe/text.pdf"); if (PEAR::isError($result)) { echo $result->getMessage(); } else { $response = $req->sendRequest(); if (PEAR::isError($response)) { echo $response->getMessage(); } else { echo $req->getResponseBody(); } } </programlisting> </example> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/co.php/peardoc/ja/package/http/http-request/headers.xml?r=1.1&p=1 Index: peardoc/ja/package/http/http-request/headers.xml +++ peardoc/ja/package/http/http-request/headers.xml <?xml version="1.0" encoding="utf-8" ?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.1 Maintainer: shimooka Status: ready --> <refentry id="package.http.http-request.headers"> <refnamediv> <refname>ãªã¯ã¨ã¹ãããã</refname> <refpurpose> HTTP ãªã¯ã¨ã¹ãã«ä»å çãªã®ãããã追å ãã </refpurpose> </refnamediv> <refsect1 id="package.http.http-request.headers.usage"> <title>ãªã¯ã¨ã¹ããããã®è¿½å æ¹æ³</title> <example> <title>ã«ã¹ã¿ã ãªã¯ã¨ã¹ããããã®è¿½å </title> <para> 以ä¸ã®ä¾ã§ã¯ãHTTP ããã <literal>X-PHP-Version</literal> ã HTTP ãªã¯ã¨ã¹ãã«è¿½å ããã¾ãããã®ãããã®å¤ã¯ã <classname>HTTP_Request</classname> ã¤ã³ã¹ã¿ã³ã¹ãåä½ãã¦ãã PHP ã¤ã³ã¿ããªã¿ã®ãã¼ã¸ã§ã³æååã§ãã </para> <programlisting role="php"> require_once "HTTP/Request.php"; $req =& new HTTP_Request("http://example.com/"); $req->addHeader("X-PHP-Version", phpversion()); $response = $req->sendRequest(); if (PEAR::isError($response)) { echo $response->getMessage(); } else { echo $req->getResponseBody(); } </programlisting> </example> <para> <classname>HTTP_Request</classname> ãªãã¸ã§ã¯ãã«è¿½å ããããããã¯ã <function>sendRequest</function> ãã³ã¼ã«ãããåã« <function>removeHeader</function> ã§åé¤ãããã¨ãã§ãã¾ãã </para> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/co.php/peardoc/ja/package/http/http-request/intro.xml?r=1.1&p=1 Index: peardoc/ja/package/http/http-request/intro.xml +++ peardoc/ja/package/http/http-request/intro.xml <?xml version="1.0" encoding="utf-8" ?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.2 Maintainer: shimooka Status: ready --> <refentry id="package.http.http-request.intro"> <refnamediv> <refname>å°å ¥</refname> <refpurpose> <classname>HTTP_Request</classname> å°å ¥ </refpurpose> </refnamediv> <refsect1 id="package.http.http-request.intro.overview"> <title>æ¦è¦</title> <para> ãã®ããã±ã¼ã¸ã使ç¨ãããã¨ã§ã<acronym>PHP</acronym> ã¹ã¯ãªãããã HTTP ãªã¯ã¨ã¹ããç°¡åã«å¦çãããã¨ãã§ãã¾ãã ããã¯ãGET/POST/HEAD/TRACE/PUT/DELETEãBasic èªè¨¼ããããã·ã ãããã·èªè¨¼ãSSLããã¡ã¤ã«ã¢ãããã¼ããªã©ããµãã¼ããã¦ãã¾ãã </para> <para> åè¿°ã®ç¹é·ã®ããã<classname>HTTP_Request</classname> 㯠PHP ã¢ããªã±ã¼ã·ã§ã³ã§åºãç¥ããã Mozilla ãã©ã¦ã¶ã®ãã㪠Web ãã©ã¦ã¶ã®ã»ã¨ãã©ã®æ©è½ã模å£ãããã¨ãå¯è½ã«ãã¾ãã å¯è½ãªã¢ããªã±ã¼ã·ã§ã³ç¯å²ã¯ã次ã®éãã§ã: <itemizedlist> <listitem> <simpara> <function><link linkend="package.http.http-request.response-eval.codes">getResponseCode</link></function> ã®å©ãã«ãã WWW ãªã³ã¯ã®æå¹æ§ããã§ãã¯ããã㨠</simpara> </listitem> <listitem> <simpara> ãªã¢ã¼ãã® Web ãã¼ã¸ãåãè¾¼ã¿ãçµæããã¼ã¹ããã㨠</simpara> </listitem> <listitem> <simpara> ãã®ä» </simpara> </listitem> </itemizedlist> </para> </refsect1> <refsect1 id="package.http.http-request.intro.examples"> <title>ããã¤ãã®ä¾</title> <example> <title> <ulink url="http://yahoo.com/">yahoo.com</ulink> ã®å 容ãåå¾ãã ããã表示ãã </title> <programlisting role="php"> require_once "HTTP/Request.php"; $req =& new HTTP_Request("http://www.yahoo.com/"); if (!PEAR::isError($req->sendRequest())) { echo $req->getResponseBody(); } </programlisting> </example> <example> <title>äºã¤ã® Web ãµã¤ãã®å 容ãåå¾ããä¸è¡ã§è¡¨ç¤ºãã</title> <para> ãã®ä¾ã§ã¯ãäºã¤ã® Web ãµã¤ãã®å 容ãåå¾ããã表示ããã¾ãã åè 㯠POST ãã©ã¡ã¼ã¿ãå¦çããã¾ããPOST ãã¼ã¿ã¹ã¿ãã¯ã¯ã äºçªç®ã® Web ãµã¤ãã®å 容ãåå¾ãããåã«ã¯ãªã¢ããã¾ãã </para> <programlisting role="php"> require_once "HTTP/Request.php"; $req =& new HTTP_Request("http://www.php.net"); $req->setMethod(HTTP_REQUEST_METHOD_POST); $req->addPostData("Foo", "bar"); if (!PEAR::isError($req->sendRequest())) { $response1 = $req->getResponseBody(); } else { $response1 = ""; } $req->setMethod(HTTP_REQUEST_METHOD_GET); $req->setURL("http://pear.php.net"); $req->clearPostData(); if (!PEAR::isError($req->sendRequest())) { $response2 = $req->getResponseBody(); } else { $response2 = ""; } echo $response1; echo $response2; </programlisting> </example> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/co.php/peardoc/ja/package/http/http-request/proxy-auth.xml?r=1.1&p=1 Index: peardoc/ja/package/http/http-request/proxy-auth.xml +++ peardoc/ja/package/http/http-request/proxy-auth.xml <?xml version="1.0" encoding="utf-8" ?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.1 Maintainer: shimooka Status: ready --> <refentry id="package.http.http-request.proxy-auth"> <refnamediv> <refname>ãããã·èªè¨¼</refname> <refpurpose> HTTP ãããã·ãå©ç¨ãã </refpurpose> </refnamediv> <refsect1 id="package.http.http-request.proxy-auth.usage"> <title>ãããã·èªè¨¼ã®ä½¿ç¨æ¹æ³</title> <example> <title>å¿åã¢ã¯ã»ã¹ã§ãããã·ãµã¼ããå©ç¨ãã</title> <para> ãã®ä¾ã§ã¯ããããã·ãµã¼ãããã¼ã <literal>8080</literal> ã§å¾ æ©ãã¦ããã example.com ã¸ã®å¤åãæ¥ç¶ã®ä»£çï¼ãããã·ï¼ãè¡ã£ã¦ãã <literal>proxy.example.com</literal> ã¨ãããã¹ãåã®ãã·ã³ã å©ç¨ãããã¨ãã¦ãããã¨æ³å®ãã¦ãã¾ãã </para> <para> <function>setProxy</function> ã®äºçªç®ã®ãã©ã¡ã¼ã¿ã¯ãªãã·ã§ã³ã§ã ããã©ã«ã㯠<literal>8080</literal> ã§ãã </para> <programlisting role="php"> require_once "HTTP/Request.php"; $req =& new HTTP_Request("http://example.com/"); $req->setProxy("proxy.example.com", 8080); </programlisting> </example> <example> <title>ãããã·èªè¨¼ã®å©ç¨</title> <para> ããã¯ããããã·ãµã¼ãã§ã®ã¦ã¼ã¶ã¼èªè¨¼ã®ããã®ã¦ã¼ã¶ã¼å/ãã¹ã¯ã¼ãã® ã¿ãã«ãæä¾ããã¦ãããã¨ãé¤ãã¦ãä¸è¨ã¨åãä¾ã§ã: ã¦ã¼ã¶ã¼å㯠<literal>johndoe</literal> ã§ä»éãããã¹ã¯ã¼ã㯠<literal>foo</literal> ã§ãã </para> <programlisting role="php"> require_once "HTTP/Request.php"; $req =& new HTTP_Request("http://example.com/"); $req->setProxy("proxy.example.com", 8080, "johndoe", "foo"); </programlisting> </example> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/co.php/peardoc/ja/package/http/http-request/response-eval.xml?r=1.1&p=1 Index: peardoc/ja/package/http/http-request/response-eval.xml +++ peardoc/ja/package/http/http-request/response-eval.xml <?xml version="1.0" encoding="utf-8" ?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.1 Maintainer: shimooka Status: ready --> <refentry id="package.http.http-request.response-eval"> <refnamediv> <refname>ã¬ã¹ãã³ã¹ã®è©ä¾¡</refname> <refpurpose> HTTP ã¬ã¹ãã³ã¹ããã®æ å ±ãè©ä¾¡ãã </refpurpose> </refnamediv> <refsect1 id="package.http.http-request.response-eval.intro"> <title>å°å ¥</title> <para> HTTP 㯠<emphasis>Request - Response</emphasis> ã¹ãã¼ã ã«åºã¥ãããããã³ã«ãªã®ã§ã å ¨ã¦ã® HTTP ãªã¯ã¨ã¹ã㯠HTTP ã¬ã¹ãã³ã¹ã«è¿½éããã¾ãã <classname>HTTP_Request</classname> ã¯ã ãããã®ã¬ã¹ãã³ã¹ããã®æ å ±ãè©ä¾¡ããããã¤ãã®ã¡ã½ãããæä¾ãã¦ãã¾ãã </para> </refsect1> <refsect1 id="package.http.http-request.response-eval.codes"> <title>ã¬ã¹ãã³ã¹ã³ã¼ã</title> <para> HTTP ã¬ã¹ãã³ã¹ã®éè¦ãªé¨åã¯ãã¬ã¹ãã³ã¹ã³ã¼ãã§ãã æãè¯ãç¥ãããã¬ã¹ãã³ã¹ã³ã¼ãã¯ã ããããä½åº¦ããã©ã¦ã¶ã§è¦ããã¨ããã <literal>404</literal> ã§ãããã <literal>404</literal> ã®æå³ã¯ã ãªã¯ã¨ã¹ãããããªã½ã¼ã¹ãè¦ã¤ãããã¨ãã§ããªãã£ããã¨ãããã¨ã§ãã ã¹ãã¼ã¿ã¹ã³ã¼ãã®å®å ¨ãªãªã¹ãã¯ã <ulink url="&url.rfc;2616">RFC 2616</ulink> ã«è¦ã¤ãããã¨ãã§ãã¾ãã </para> <example> <title>ã¬ã¹ãã³ã¹ã³ã¼ãããã§ãã¯ãã</title> <programlisting role="php"> require_once "HTTP/Request.php"; $urls = array( "http://www.example.com/", "http://example.com/thisdoesnotexist.html" ); $req =& new HTTP_Request(""); foreach ($urls as $url) { $req->setURL($url); $req->sendRequest(); $code = $req->getResponseCode(); switch ($code) { case 404: echo "Document not found\n"; break; case 200: echo "Everything's ok\n"; break; /* ... */ } } </programlisting> </example> </refsect1> <refsect1 id="package.http.http-request.response-eval.header"> <title>ã¬ã¹ãã³ã¹ããã</title> <para> HTTP ãªã¯ã¨ã¹ãã¨åæ§ãHTTP ã¬ã¹ãã³ã¹ã¯ãããã¨ããã£ã§æ§æããã¾ãã <classname>HTTP_Request</classname> ã¯ã ã¬ã¹ãã³ã¹ãããã«ã¢ã¯ã»ã¹ããããã®ã¡ã½ãããæä¾ãã¾ãã </para> <example> <title>ã¬ã¹ãã³ã¹ããã®å ¨ã¦ã®ããããåå¾ãã</title> <programlisting role="php"> require_once "HTTP/Request.php"; $req =& new HTTP_Request("http://example.com/"); $req->sendRequest(); foreach ($req->getResponseHeader() as $name => $value) { echo $name . " = " . $value . "\n"; } </programlisting> <para> ããã¯ãå ¨ã¦ã®ãããã¨ä»éããå¤ã表示ãã¾ãã </para> </example> <example> <title>ç¹å®ã®ããããåå¾ãã</title> <programlisting role="php"> require_once "HTTP/Request.php"; $req =& new HTTP_Request("http://example.com/"); $req->sendRequest(); echo $req->getResponseHeader("Date"); </programlisting> <para> ããã¯ã<literal>Date:</literal> ãããã®å¤ã表示ãã¾ãã </para> </example> </refsect1> <refsect1 id="package.http.http-request.response-eval.cookies"> <title>ã¯ããã¼ã®ã¬ã¹ãã³ã¹</title> <para> HTTP ã¬ã¹ãã³ã¹ã®ä¸é¨ã§ããã¯ããã¼ãåå¾ã«ã¤ãã¦ã¯ã <link linkend="package.http.http-request.cookie">Cookies</link> ã«è¨è¼ããã¦ãã¾ãã </para> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 -->