svn: /pear/peardoc/trunk/en/package/ http/http-request2/adapters.xml http/http-request2/config.xml http/http-request2/intro.xml http/http-request2/observers.xml http/http-request2/request.xml http/http-request2/response.xml http/http-request2.xml http-entities.xml
[email protected] (Alexey Borzov)
| Newsgroups | php.pear.doc |
|---|---|
| Message-ID | <[email protected]> |
avb Sun, 20 Sep 2009 15:53:31 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=288477
Log:
Started docs for HTTP_Request2 package
Changed paths:
A pear/peardoc/trunk/en/package/http/http-request2/
A pear/peardoc/trunk/en/package/http/http-request2/adapters.xml
A pear/peardoc/trunk/en/package/http/http-request2/config.xml
A pear/peardoc/trunk/en/package/http/http-request2/intro.xml
A pear/peardoc/trunk/en/package/http/http-request2/observers.xml
A pear/peardoc/trunk/en/package/http/http-request2/request.xml
A pear/peardoc/trunk/en/package/http/http-request2/response.xml
A pear/peardoc/trunk/en/package/http/http-request2.xml
U pear/peardoc/trunk/en/package/http-entities.xml
svn-diffs-288477.txt
(text/x-diff, 26.4 KB)
Added: pear/peardoc/trunk/en/package/http/http-request2/adapters.xml
===================================================================
--- pear/peardoc/trunk/en/package/http/http-request2/adapters.xml (rev 0)
+++ pear/peardoc/trunk/en/package/http/http-request2/adapters.xml 2009-09-20 15:53:31 UTC (rev 288477)
@@ -0,0 +1,170 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<refentry
+ xmlns="http://docbook.org/ns/docbook"
+ xmlns:phd="http://www.php.net/ns/phd"
+ version="lillet"
+ xml:id="package.http.http-request2.adapters"
+>
+ <refnamediv>
+ <refname>Adapters</refname>
+ <refpurpose>Classes That Actually Perform the Request</refpurpose>
+ </refnamediv>
+ <refsection xml:id="package.http.http-request2.adapters.overview">
+ <info><title>Adapters Overview</title></info>
+ <para>
+ Adapters in <classname>HTTP_Request2</classname> package are classes responsible for establishing
+ the actual connection to the remote server, writing requests and reading responses. Adapter can
+ be set either via a configuration parameter (see: <xref
+ linkend="package.http.http-request2.config"/>) or by <phd:pearapi phd:package="HTTP_Request2"
+ phd:linkend="HTTP_Request2::setAdapter" /> method.
+ </para>
+ <para>
+ The package currently contains three adapters:
+ <variablelist>
+ <varlistentry>
+ <term><classname>HTTP_Request2_Adapter_Socket</classname></term>
+ <listitem><para>
+ This Adapter uses PHP's builtin <link xmlns:xlink="http://www.w3.org/1999/xlink"
+ xlink:href="&url.php.lookup;stream_socket_client"><function>stream_socket_client</function></link>
+ function and does not require any special extensions or configuration. Note that this is a
+ pure PHP implementation of HTTP protocol, it does not use <literal>http</literal> stream
+ wrapper.
+ </para><para>
+ This is the default Adapter, it will be used by <classname>HTTP_Request2</classname> unless
+ you explicitly set the other one.
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><classname>HTTP_Request2_Adapter_Curl</classname></term>
+ <listitem><para>
+ Curl adapter wraps around PHP's cURL extension and thus allows using extremely sophisticated
+ cURL library. It is a good choice if you have cURL extension available in PHP.
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><classname>HTTP_Request2_Adapter_Mock</classname></term>
+ <listitem><para>
+ This adapter allows testing packages and applications using
+ <classname>HTTP_Request2</classname> without depending on a network connection and remote
+ server availability.
+ </para><para>
+ You can replace the default adapter in <classname>HTTP_Request2</classname> by an instance of
+ <classname>HTTP_Request2_Adapter_Mock</classname> populated via its <phd:pearapi
+ phd:package="HTTP_Request2" phd:linkend="HTTP_Request2_Adapter_Mock::addResponse" /> method.
+ The adapter will return prepared responses or throw prepared exceptions when its
+ <function>sendRequest</function> method is called.
+ </para></listitem>
+ </varlistentry>
+ </variablelist>
+ </para>
+ <para>
+ Other adapters may be created by subclassing an abstract <phd:pearapi phd:package="HTTP_Request2"
+ phd:linkend="HTTP_Request2_Adapter" /> class and implementing its <phd:pearapi phd:package="HTTP_Request2"
+ phd:linkend="HTTP_Request2_Adapter::sendRequest" /> method.
+ </para>
+ </refsection>
+
+ <refsection xml:id="package.http.http-request2.adapters.socket">
+ <info><title>Socket Adapter Issues</title></info>
+ <itemizedlist>
+ <listitem><simpara>
+ Due to <link xmlns:xlink="http://www.w3.org/1999/xlink"
+ xlink:href="&url.php.bugs;47030">PHP bug #47030</link> <literal>ssl_verify_host</literal>
+ configuration parameter is completely useless. When <literal>ssl_verify_peer</literal> is
+ switched off <emphasis>no host validation will be performed</emphasis>, when
+ <literal>ssl_verify_peer</literal> is on host validation will always be performed as part of
+ peer validation.
+ </simpara></listitem>
+ <listitem><simpara>
+ When doing a <literal>https://</literal> request through proxy, SSL peer validation will always
+ fail (PHP considers that script is connected to a proxy server but the certificate presented is
+ obviously for the remote host). Therefore <literal>ssl_verify_peer</literal> should be off when
+ using proxy.
+ </simpara></listitem>
+ </itemizedlist>
+ <para>
+ Note, that the above two problems mean that no peer validation whatsoever is possible when doing a
+ <literal>https://</literal> request through proxy using Socket adapter. If this is an issue for
+ you, consider using Curl Adapter instead.
+ </para>
+ </refsection>
+
+ <refsection xml:id="package.http.http-request2.adapters.curl">
+ <info><title>Curl Adapter Issues</title></info>
+ <para>
+ When doing a <literal>POST</literal> request with file uploads or reading the request body from
+ file, <classname>HTTP_Request2</classname> streams files from disc to reduce memory consumption
+ and to allow the request monitoring. This is done by setting up a
+ <constant>CURLOPT_READFUNCTION</constant> callback. PHP does not allow setting another callback,
+ <constant>CURLOPT_IOCTLFUNCTION</constant> (see <link xmlns:xlink="http://www.w3.org/1999/xlink"
+ xlink:href="&url.php.bugs;47204">PHP bug #47204</link>) so the request body can not be
+ "rewinded" when another request should be performed. Thus a <literal>POST</literal>
+ request to a resource protected by Digest authentication will always fail.
+ </para>
+ </refsection>
+
+ <refsection xml:id="package.http.http-request2.adapters.mock">
+ <info><title>Using Mock adapter</title></info>
+ <para>
+ <phd:pearapi phd:package="HTTP_Request2" phd:linkend="HTTP_Request2_Adapter_Mock::addResponse" />
+ method can accept either a HTTP response (instance of
+ <classname>HTTP_Request2_Response</classname>, a string, a pointer to an open file) or an
+ <classname>Exception</classname>. The latter may be useful to test that your application degrades
+ gracefully when the remote server is not available due to some network problems. Several
+ responses may be added via <function>addResponse</function> to simulate a HTTP transaction
+ consisting of multiple requests and responses. They will be returned by the Adapter in the order
+ they were added.
+ </para>
+ <para>
+ <example>
+ <title>Returning responses and throwing exceptions</title>
+ <programlisting role="php"><![CDATA[
+require_once 'HTTP/Request2.php';
+require_once 'HTTP/Request2/Adapter/Mock.php';
+
+$mock = new HTTP_Request2_Adapter_Mock();
+$mock->addResponse(
+ "HTTP/1.1 200 OK\r\n" .
+ "Content-Length: 32\r\n" .
+ "Connection: close\r\n" .
+ "\r\n" .
+ "Nothing to see here, move along."
+);
+$mock->addResponse(
+ new HTTP_Request2_Exception("The server is on fire!")
+);
+
+// this request will succeed
+$request1 = new HTTP_Request2(
+ 'http://ok.example.com/', HTTP_Request2::METHOD_GET,
+ array('adapter' => $mock)
+);
+echo "Response: " . $request1->send()->getBody() . "\r\n";
+
+// this request will fail
+$request2 = new HTTP_Request2('http://burning.example.com/');
+$request2->setAdapter($mock);
+try {
+ echo "Response: " . $request2->send()->getBody() . "\r\n";
+} catch (Exception $e) {
+ echo "Error: " . $e->getMessage() . "\r\n";
+}
+]]>
+ </programlisting>
+ <simpara>The above code will output:</simpara>
+ <screen><![CDATA[
+Response: Nothing to see here, move along.
+Error: The server is on fire!
+]]>
+ </screen>
+ </example>
+ </para>
+ <para>
+ Mock Adapter also has two static helper methods <phd:pearapi phd:package="HTTP_Request2"
+ phd:linkend="HTTP_Request2_Adapter_Mock::createResponseFromString" /> and <phd:pearapi phd:package="HTTP_Request2"
+ phd:linkend="HTTP_Request2_Adapter_Mock::createResponseFromFile" /> which build
+ <classname>HTTP_Request2_Response</classname> objects from either a string containing the
+ complete HTTP response or a pointer to an open file with such response, respectively.
+ </para>
+ </refsection>
+</refentry>
Added: pear/peardoc/trunk/en/package/http/http-request2/config.xml
===================================================================
--- pear/peardoc/trunk/en/package/http/http-request2/config.xml (rev 0)
+++ pear/peardoc/trunk/en/package/http/http-request2/config.xml 2009-09-20 15:53:31 UTC (rev 288477)
@@ -0,0 +1,222 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:phd="http://www.php.net/ns/phd" version="lillet" xml:id="package.http.http-request2.config">
+ <refnamediv>
+ <refname>Configuration</refname>
+ <refpurpose>Configuration Parameters for <classname>HTTP_Request2</classname></refpurpose>
+ </refnamediv>
+ <refsection xml:id="package.http.http-request2.config.table">
+ <info><title>List of Configuration Parameters</title></info>
+ <para>
+ <classname>HTTP_Request2</classname> <phd:pearapi phd:package="HTTP_Request2"
+ phd:linkend="HTTP_Request2::__construct">constructor</phd:pearapi> and <phd:pearapi
+ phd:package="HTTP_Request2" phd:linkend="HTTP_Request2::setConfig" /> method accept the
+ following configuration parameters. You can also use <phd:pearapi phd:package="HTTP_Request2"
+ phd:linkend="HTTP_Request2::getConfig" /> to get the values of these parameters. Note that using
+ an unknown parameter name will result in an exception.
+ <table>
+ <title>Common parameters</title>
+ <tgroup cols="4">
+ <thead>
+ <row>
+ <entry>Parameter name</entry>
+ <entry>Description</entry>
+ <entry>Expected type</entry>
+ <entry>Default value</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row valign="top">
+ <entry><literal>adapter</literal></entry>
+ <entry>Adapter to use, may also be set by <phd:pearapi phd:package="HTTP_Request2"
+ phd:linkend="HTTP_Request2::setAdapter" /> method. (See: <xref
+ linkend="package.http.http-request2.adapters" />)</entry>
+ <entry>&type.string;|&type.object;</entry>
+ <entry><literal>'HTTP_Request2_Adapter_Socket'</literal></entry>
+ </row>
+ <row valign="top">
+ <entry><literal>connect_timeout</literal></entry>
+ <entry>Connection timeout in seconds. Exception will be thrown if connecting to remote host
+ takes more than this number of seconds.</entry>
+ <entry>&type.integer;</entry>
+ <entry><literal>10</literal></entry>
+ </row>
+ <row valign="top">
+ <entry><literal>timeout</literal></entry>
+ <entry>Total number of seconds a request can take. Use <literal>0</literal> for no limit,
+ should be greater than <literal>connect_timeout</literal> if set. Exception will be thrown
+ if execution of <phd:pearapi phd:package="HTTP_Request2" phd:linkend="HTTP_Request2::send" />
+ takes more than this number of seconds.</entry>
+ <entry>&type.integer;</entry>
+ <entry><literal>0</literal></entry>
+ </row>
+ <row valign="top">
+ <entry><literal>use_brackets</literal></entry>
+ <entry>Whether to append [] to array variable names. This is useful when performing a request
+ to a remote PHP page which expects array parameters to have brackets, should be turned off in
+ the other cases.</entry>
+ <entry>&type.bool;</entry>
+ <entry>&true;</entry>
+ </row>
+ <row valign="top">
+ <entry><literal>protocol_version</literal></entry>
+ <entry>HTTP protocol version to use, <literal>'1.0'</literal> or <literal>'1.1'</literal></entry>
+ <entry>&type.string;</entry>
+ <entry><literal>'1.1'</literal></entry>
+ </row>
+ <row valign="top">
+ <entry><literal>buffer_size</literal></entry>
+ <entry>Buffer size to use for reading and writing. Leave this at the default unless you know
+ what you are doing.</entry>
+ <entry>&type.integer;</entry>
+ <entry><literal>16384</literal></entry>
+ </row>
+ <row valign="top">
+ <entry><literal>store_body</literal></entry>
+ <entry>Whether to store response body in response object. Set to false if receiving a huge
+ response and using an Observer to save it. (See: <xref
+ linkend="package.http.http-request2.observers" />)
+ </entry>
+ <entry>&type.bool;</entry>
+ <entry>&true;</entry>
+ </row>
+ <row valign="top">
+ <entry><literal>digest_compat_ie</literal></entry>
+ <entry>Whether to imitate behaviour of MSIE 5 and 6 in using URL without query string in digest
+ authentication</entry>
+ <entry>&type.bool;</entry>
+ <entry>&false;</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+ <table>
+ <title>Proxy parameters</title>
+ <tgroup cols="4">
+ <thead>
+ <row>
+ <entry>Parameter name</entry>
+ <entry>Description</entry>
+ <entry>Expected type</entry>
+ <entry>Default value</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row valign="top">
+ <entry><literal>proxy_host</literal></entry>
+ <entry>Proxy server host</entry>
+ <entry>&type.string;</entry>
+ <entry><literal>''</literal></entry>
+ </row>
+ <row valign="top">
+ <entry><literal>proxy_port</literal></entry>
+ <entry>Proxy server port</entry>
+ <entry>&type.integer;</entry>
+ <entry><literal>''</literal></entry>
+ </row>
+ <row valign="top">
+ <entry><literal>proxy_user</literal></entry>
+ <entry>User name for proxy authentication</entry>
+ <entry>&type.string;</entry>
+ <entry><literal>''</literal></entry>
+ </row>
+ <row valign="top">
+ <entry><literal>proxy_password</literal></entry>
+ <entry>Password for proxy authentication</entry>
+ <entry>&type.string;</entry>
+ <entry><literal>''</literal></entry>
+ </row>
+ <row valign="top">
+ <entry><literal>proxy_auth_scheme</literal></entry>
+ <entry>Proxy authentication scheme, one of <constant>HTTP_Request2::AUTH_*</constant> constants</entry>
+ <entry>&type.string;</entry>
+ <entry><constant>HTTP_Request2::AUTH_BASIC</constant></entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+ <table>
+ <title>SSL parameters</title>
+ <tgroup cols="4">
+ <thead>
+ <row>
+ <entry>Parameter name</entry>
+ <entry>Description</entry>
+ <entry>Expected type</entry>
+ <entry>Default value</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row valign="top">
+ <entry><literal>ssl_verify_peer</literal></entry>
+ <entry>Whether to verify peer's SSL certificate. Note that this is on by default, to follow
+ the behaviour of modern browsers and current cURL version. <link
+ linkend="package.http.http-request2.adapters.socket">Issues with Socket Adapter.</link></entry>
+ <entry>&type.bool;</entry>
+ <entry>&true;</entry>
+ </row>
+ <row valign="top">
+ <entry><literal>ssl_verify_host</literal></entry>
+ <entry>Whether to check that Common Name in SSL certificate matches host name. <link
+ linkend="package.http.http-request2.adapters.socket">Issues with Socket Adapter.</link></entry>
+ <entry>&type.bool;</entry>
+ <entry>&true;</entry>
+ </row>
+ <row valign="top">
+ <entry><literal>ssl_cafile</literal></entry>
+ <entry>Certificate Authority file to verify the peer with (use when
+ <literal>ssl_verify_peer</literal> is &true;)</entry>
+ <entry>&type.string;</entry>
+ <entry>&null;</entry>
+ </row>
+ <row valign="top">
+ <entry><literal>ssl_capath</literal></entry>
+ <entry>Directory holding multiple Certificate Authority files</entry>
+ <entry>&type.string;</entry>
+ <entry>&null;</entry>
+ </row>
+ <row valign="top">
+ <entry><literal>ssl_local_cert</literal></entry>
+ <entry>Name of a file containing local certificate</entry>
+ <entry>&type.string;</entry>
+ <entry>&null;</entry>
+ </row>
+ <row valign="top">
+ <entry><literal>ssl_passphrase</literal></entry>
+ <entry>Passphrase with which local certificate was encoded</entry>
+ <entry>&type.string;</entry>
+ <entry>&null;</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+ </para>
+ </refsection>
+ <refsection xml:id="package.http.http-request2.config.proxy">
+ <info><title>Proxy Configuration</title></info>
+ <para>
+ While most of the configuration parameters have sane default values and generally can be left
+ alone, you'll definitely need to configure proxy you are using to access websites.
+ </para>
+ <example>
+ <title>Proxy configuration example</title>
+ <programlisting role="php"><![CDATA[
+require_once 'HTTP/Request2.php';
+
+$request = new HTTP_Request2();
+$request->setConfig(array(
+ 'proxy_host' => 'proxy.example.com',
+ 'proxy_port' => 3128,
+ 'proxy_user' => 'luser',
+ 'proxy_password' => 'sekret',
+ 'proxy_auth_scheme' => HTTP_Request2::AUTH_DIGEST
+));
+
+// Now you can perform requests
+
+]]></programlisting>
+ </example>
+ </refsection>
+</refentry>
Added: pear/peardoc/trunk/en/package/http/http-request2/intro.xml
===================================================================
--- pear/peardoc/trunk/en/package/http/http-request2/intro.xml (rev 0)
+++ pear/peardoc/trunk/en/package/http/http-request2/intro.xml 2009-09-20 15:53:31 UTC (rev 288477)
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<refentry xmlns="http://docbook.org/ns/docbook" version="lillet" xml:id="package.http.http-request2.intro">
+ <refnamediv>
+ <refname>Introduction</refname>
+ <refpurpose>Introduction to <classname>HTTP_Request2</classname></refpurpose>
+ </refnamediv>
+ <refsection xml:id="package.http.http-request2.intro.overview">
+ <info><title>Package Overview</title></info>
+ <para>
+ <classname>HTTP_Request2</classname> package provides an easy way for <acronym>PHP</acronym>
+ applications to perform <acronym>HTTP</acronym> requests. It supports a large subset of Hypertext
+ Transfer Protocol features, and can be used for the following:
+ <itemizedlist>
+ <listitem><simpara>
+ Working with web services (numerous <acronym>PEAR</acronym> packages in Web Services category
+ are using <classname>HTTP_Request2</classname> under the hood);
+ </simpara></listitem>
+ <listitem><simpara>
+ Checking the validity of web links;
+ </simpara></listitem>
+ <listitem><simpara>
+ Grabbing and parsing remote web pages;
+ </simpara></listitem>
+ <listitem><simpara>
+ Automated form submission.
+ </simpara></listitem>
+ </itemizedlist>
+ </para>
+ </refsection>
+ <refsection xml:id="package.http.http-request2.intro.basic-example">
+ <info><title>Basic Usage Example</title></info>
+ <example>
+ <info>
+ <title>
+ Fetches and displays PEAR website homepage
+ </title>
+ </info>
+ <programlisting role="php">
+<![CDATA[
+require_once 'HTTP/Request2.php';
+
+$request = new HTTP_Request2('http://pear.php.net/', HTTP_Request2::METHOD_GET);
+try {
+ $response = $request->send();
+ if (200 == $response->getStatus()) {
+ echo $response->getBody();
+ } else {
+ echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
+ $response->getReasonPhrase();
+ }
+} catch (HTTP_Request2_Exception $e) {
+ echo 'Error: ' . $e->getMessage();
+}
+]]>
+ </programlisting>
+ </example>
+ </refsection>
+</refentry>
Added: pear/peardoc/trunk/en/package/http/http-request2/observers.xml
===================================================================
--- pear/peardoc/trunk/en/package/http/http-request2/observers.xml (rev 0)
+++ pear/peardoc/trunk/en/package/http/http-request2/observers.xml 2009-09-20 15:53:31 UTC (rev 288477)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<refentry xmlns="http://docbook.org/ns/docbook" version="lillet" xml:id="package.http.http-request2.observers">
+ <refnamediv>
+ <refname>Observers</refname>
+ <refpurpose>Monitoring the Request's Progress</refpurpose>
+ </refnamediv>
+ <refsection xml:id="package.http.http-request2.observers.overview">
+ <info><title>Observers Overview</title></info>
+ <para>
+ </para>
+ </refsection>
+ <refsection xml:id="package.http.http-request2.observers.example">
+ <info><title>Observers Example</title></info>
+ <para>
+ </para>
+ </refsection>
+</refentry>
Added: pear/peardoc/trunk/en/package/http/http-request2/request.xml
===================================================================
--- pear/peardoc/trunk/en/package/http/http-request2/request.xml (rev 0)
+++ pear/peardoc/trunk/en/package/http/http-request2/request.xml 2009-09-20 15:53:31 UTC (rev 288477)
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<refentry
+ xmlns="http://docbook.org/ns/docbook"
+ xmlns:phd="http://www.php.net/ns/phd"
+ version="lillet"
+ xml:id="package.http.http-request2.request"
+>
+ <refnamediv>
+ <refname><classname>HTTP_Request2</classname></refname>
+ <refpurpose>Class Representing a HTTP Request</refpurpose>
+ </refnamediv>
+ <refsection xml:id="package.http.http-request2.request.url">
+ <info><title>Request <acronym>URL</acronym> and <literal>GET</literal> Parameters</title></info>
+ <para>
+ Request URL can be set in <classname>HTTP_Request2</classname> <phd:pearapi phd:package="HTTP_Request2"
+ phd:linkend="HTTP_Request2::__construct">constructor</phd:pearapi> or via <phd:pearapi
+ phd:package="HTTP_Request2" phd:linkend="HTTP_Request2::setUrl" /> method. Both of these accept
+ either a string or an instance of <phd:pearapi phd:package="Net_URL2" />.
+ URL is stored internally as an instance of <classname>Net_URL2</classname> that can be accessed
+ via <phd:pearapi phd:package="HTTP_Request2" phd:linkend="HTTP_Request2::getUrl" />.
+ </para>
+ <para>
+ <literal>GET</literal> request parameters can be added to URL via <phd:pearapi
+ phd:package="Net_URL2" phd:linkend="Net_URL2::setQueryVariable" /> and <phd:pearapi
+ phd:package="Net_URL2" phd:linkend="Net_URL2::setQueryVariables" />:
+ <example>
+ <title>Setting <literal>GET</literal> parameters</title>
+ <programlisting role="php"><![CDATA[
+require_once 'HTTP/Request2.php';
+
+$request = new HTTP_Request2('http://pear.php.net/bugs/search.php');
+$url = $request->getUrl();
+// Explicitly set use_brackets
+$url->setOption(Net_URL2::OPTION_USE_BRACKETS, true);
+$url->setQueryVariables(array(
+ 'package_name' => array('HTTP_Request2', 'Net_URL2'),
+ 'status' => 'Open'
+));
+$url->setQueryVariable('cmd', 'display');
+
+// This will output a page with open bugs for Net_URL2 and HTTP_Request2
+echo $request->send()->getBody();
+]]>
+ </programlisting>
+ </example>
+ </para>
+ </refsection>
+
+ <refsection xml:id="package.http.http-request2.request.auth">
+ <info><title>HTTP Authentication</title></info>
+ <para>
+ </para>
+ </refsection>
+
+ <refsection xml:id="package.http.http-request2.request.headers">
+ <info><title>Request Headers and Cookies</title></info>
+ <para>
+ </para>
+ </refsection>
+
+ <refsection xml:id="package.http.http-request2.request.body">
+ <info><title>Request Body</title></info>
+ <para>
+ </para>
+ </refsection>
+</refentry>
Added: pear/peardoc/trunk/en/package/http/http-request2/response.xml
===================================================================
--- pear/peardoc/trunk/en/package/http/http-request2/response.xml (rev 0)
+++ pear/peardoc/trunk/en/package/http/http-request2/response.xml 2009-09-20 15:53:31 UTC (rev 288477)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<refentry xmlns="http://docbook.org/ns/docbook" version="lillet" xml:id="package.http.http-request2.response">
+ <refnamediv>
+ <refname><classname>HTTP_Request2_Response</classname></refname>
+ <refpurpose>Class Representing a HTTP Response</refpurpose>
+ </refnamediv>
+ <refsection xml:id="package.http.http-request2.response.overview">
+ <info><title><classname>HTTP_Request2_Response</classname> Overview</title></info>
+ <para>
+ </para>
+ </refsection>
+ <refsection xml:id="package.http.http-request2.response.reading">
+ <info><title>Reading the Response</title></info>
+ <para>
+ </para>
+ </refsection>
+</refentry>
\ No newline at end of file
Added: pear/peardoc/trunk/en/package/http/http-request2.xml
===================================================================
--- pear/peardoc/trunk/en/package/http/http-request2.xml (rev 0)
+++ pear/peardoc/trunk/en/package/http/http-request2.xml 2009-09-20 15:53:31 UTC (rev 288477)
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<book xmlns="http://docbook.org/ns/docbook" version="lillet" xml:id="package.http.http-request2">
+ <info>
+ <title>HTTP_Request2</title>
+ <abstract>
+ <para>
+ PHP5 rewrite of <link linkend="package.http.http-request"><classname>HTTP_Request</classname></link>
+ package. Provides cleaner API and pluggable Adapters:
+ <itemizedlist>
+ <listitem><simpara>Socket adapter, based on old HTTP_Request code,</simpara></listitem>
+ <listitem><simpara>Curl adapter, wraps around PHP's cURL extension,</simpara></listitem>
+ <listitem><simpara>Mock adapter, useful for testing packages dependent on HTTP_Request2.</simpara></listitem>
+ </itemizedlist>
+ </para>
+ <simpara>
+ Supports POST requests with data and file uploads, basic and digest
+ authentication, cookies, proxies, gzip and deflate encodings, monitoring
+ the request progress with Observers...
+ </simpara>
+ </abstract>
+ </info>
+ <chapter>
+ &package.http.http-request2.intro;
+ &package.http.http-request2.config;
+ &package.http.http-request2.request;
+ &package.http.http-request2.adapters;
+ &package.http.http-request2.response;
+ &package.http.http-request2.observers;
+ </chapter>
+</book>
Modified: pear/peardoc/trunk/en/package/http-entities.xml
===================================================================
--- pear/peardoc/trunk/en/package/http-entities.xml 2009-09-20 14:56:29 UTC (rev 288476)
+++ pear/peardoc/trunk/en/package/http-entities.xml 2009-09-20 15:53:31 UTC (rev 288477)
@@ -2,6 +2,7 @@
&package.http.http-client;
&package.http.http-download;
&package.http.http-request;
+&package.http.http-request2;
&package.http.http-session;
&package.http.http-session2;
&package.http.http-upload;