<commit_before><sect1 id="zend.http.client">
    <title>Zend_Http_Client - Introduction</title>

    <sect2 id="zend.http.client.introduction">
        <title>Introduction</title>
        <para>
            Zend_Http_Client provides an easy interface for preforming Hyper-Text
            Transfer Protocol (HTTP) requests. Zend_Http_Client supports most simple
            features expected from an HTTP client, as well as some more complex
            features such as HTTP authentication and file uploads. Successful
            requests (and most unsuccessful ones too) return a Zend_Http_Response
            object, which provides access to the response's headers and body (see
            <xref linkend="zend.http.response" />).
        </para>
        <para>
            The class constructor optionally accepts a URL as it's first parameter
            (can be either a string or a Zend_Uri_Http object), and an optional
            array of configuration parameters. Both can be left out,
            and set later using the setUri() and setConfig() methods.
            <example id="zend.http.client.introduction.example-1">
                <title>Instantiating a Zend_Http_Client object</title>
                <programlisting role="php"><![CDATA[
$client = new Zend_Http_Client('http://example.org', array(
    'maxredirects' => 0,
    'timeout'      => 30));

// This is actually exactly the same:
$client = new Zend_Http_Client();
$client->setUri('http://example.org');
$client->setConfig(array(
    'maxredirects' => 0,
    'timeout'      => 30));
]]>
                </programlisting>
            </example>

            <note>
                <para>Zend_Http_Client uses Zend_Uri_Http to validate URLs. This means
                that some special characters like the pipe symbol ('|') or the
                caret symbol ('^') will not be accepted in the URL by default.

                This can be modified by setting the 'allow_unwise' option of
                Zend_Uri to 'true'. See <xref linkend="zend.uri.validation.allowunwise" />
                for more information.</para>
            </note>
        </para>
    </sect2>
    <sect2 id="zend.http.client.configuration">
        <title>Configuration Parameters</title>
        <para>
            The constructor and setConfig() method accept an associative array
            of configuration parameters. Setting these parameters is optional,
            as they all have default values.
            <table id="zend.http.client.configuration.table">
                <title>Zend_Http_Client configuration parameters</title>
                <tgroup cols="4">
                    <thead>
                        <row>
                            <entry>Parameter</entry>
                            <entry>Description</entry>
                            <entry>Expected Values</entry>
                            <entry>Default Value</entry>
                        </row>
                    </thead>
                    <tbody>
                        <row>
                            <entry>maxredirects</entry>
                            <entry>Maximum number of redirections to follow (0 = none)</entry>
                            <entry>integer</entry>
                            <entry>5</entry>
                        </row>
                        <row>
                            <entry>strict</entry>
                            <entry>Whether perform validation on header names. When set to false, validation functions will be skipped.
                            Usually this should not be changed</entry>
                            <entry>boolean</entry>
                            <entry>true</entry>
                        </row>
                        <row>
                            <entry>strictredirects</entry>
                            <entry>Whether to strictly follow the RFC when redirecting (see <xref linkend="zend.http.client.redirections" />)</entry>
                            <entry>boolean</entry>
                            <entry>false</entry>
                        </row>
                        <row>
                            <entry>useragent</entry>
                            <entry>User agent identifier string (sent in request headers)</entry>
                            <entry>string</entry>
                            <entry>'Zend_Http_Client'</entry>
                        </row>
                        <row>
                            <entry>timeout</entry>
                            <entry>Connection timeout (seconds)</entry>
                            <entry>integer</entry>
                            <entry>10</entry>
                        </row>
                        <row>
                            <entry>httpversion</entry>
                            <entry>HTTP protocol version (usually '1.1' or '1.0')</entry>
                            <entry>string</entry>
                            <entry>'1.1'</entry>
                        </row>
                        <row>
                            <entry>adapter</entry>
                            <entry>Connection adapter class to use (see <xref linkend="zend.http.client.adapters" />)</entry>
                            <entry>mixed</entry>
                            <entry>'Zend_Http_Client_Adapter_Socket'</entry>
                        </row>
                        <row>
                            <entry>keepalive</entry>
                            <entry>Whether to enable keep-alive connections with the server. Useful and might improve performance if several
                            consecutive requests to the same server are performed.</entry>
                            <entry>boolean</entry>
                            <entry>false</entry>
                        </row>
                        <row>
                            <entry>storeresponse</entry>
                            <entry>Whether to store last response for later retrieval with getLastResponse(). If set to false
                            getLastResponse() will return null.</entry>
                            <entry>boolean</entry>
                            <entry>true</entry>
                        </row>
                    </tbody>
                </tgroup>
            </table>
        </para>
    </sect2>
    <sect2 id="zend.http.client.basic-requests">
        <title>Performing Basic HTTP Requests</title>
        <para>
            Performing simple HTTP requests is very easily done using the
            request() method, and rarely needs more than three lines of code:
            <example id="zend.http.client.basic-requests.example-1">
                <title>Performing a Simple GET Request</title>
                <programlisting role="php"><![CDATA[
$client = new Zend_Http_Client('http://example.org');
$response = $client->request();
]]>
                </programlisting>
            </example>
            The request() method takes one optional parameter - the request method.
            This can be either GET, POST, PUT, HEAD, DELETE, TRACE, OPTIONS or
            CONNECT as defined by the HTTP protocol
            <footnote>
              <para>
                See RFC 2616 - <ulink url="http://www.w3.org/Protocols/rfc2616/rfc2616.html" />.
              </para>
            </footnote>.
            For convenience, these are all defined as class constants:
            Zend_Http_Request::GET, Zend_Http_Request::POST and so on.
        </para>
        <para>
            If no method is specified, the method set by the last setMethod()
            call is used. If setMethod() was never called, the default request
            method is GET (see the above example).<commit_msg>Fix ZF-5365<commit_after><sect1 id="zend.http.client">
    <title>Zend_Http_Client - Introduction</title>

    <sect2 id="zend.http.client.introduction">
        <title>Introduction</title>
        <para>
            Zend_Http_Client provides an easy interface for preforming Hyper-Text
            Transfer Protocol (HTTP) requests. Zend_Http_Client supports most simple
            features expected from an HTTP client, as well as some more complex
            features such as HTTP authentication and file uploads. Successful
            requests (and most unsuccessful ones too) return a Zend_Http_Response
            object, which provides access to the response's headers and body (see
            <xref linkend="zend.http.response" />).
        </para>
        <para>
            The class constructor optionally accepts a URL as it's first parameter
            (can be either a string or a Zend_Uri_Http object), and an optional
            array of configuration parameters. Both can be left out,
            and set later using the setUri() and setConfig() methods.
            <example id="zend.http.client.introduction.example-1">
                <title>Instantiating a Zend_Http_Client object</title>
                <programlisting role="php"><![CDATA[
$client = new Zend_Http_Client('http://example.org', array(
    'maxredirects' => 0,
    'timeout'      => 30));

// This is actually exactly the same:
$client = new Zend_Http_Client();
$client->setUri('http://example.org');
$client->setConfig(array(
    'maxredirects' => 0,
    'timeout'      => 30));
]]>
                </programlisting>
            </example>

            <note>
                <para>Zend_Http_Client uses Zend_Uri_Http to validate URLs. This means
                that some special characters like the pipe symbol ('|') or the
                caret symbol ('^') will not be accepted in the URL by default.

                This can be modified by setting the 'allow_unwise' option of
                Zend_Uri to 'true'. See <xref linkend="zend.uri.validation.allowunwise" />
                for more information.</para>
            </note>
        </para>
    </sect2>
    <sect2 id="zend.http.client.configuration">
        <title>Configuration Parameters</title>
        <para>
            The constructor and setConfig() method accept an associative array
            of configuration parameters. Setting these parameters is optional,
            as they all have default values.
            <table id="zend.http.client.configuration.table">
                <title>Zend_Http_Client configuration parameters</title>
                <tgroup cols="4">
                    <thead>
                        <row>
                            <entry>Parameter</entry>
                            <entry>Description</entry>
                            <entry>Expected Values</entry>
                            <entry>Default Value</entry>
                        </row>
                    </thead>
                    <tbody>
                        <row>
                            <entry>maxredirects</entry>
                            <entry>Maximum number of redirections to follow (0 = none)</entry>
                            <entry>integer</entry>
                            <entry>5</entry>
                        </row>
                        <row>
                            <entry>strict</entry>
                            <entry>Whether perform validation on header names. When set to false, validation functions will be skipped.
                            Usually this should not be changed</entry>
                            <entry>boolean</entry>
                            <entry>true</entry>
                        </row>
                        <row>
                            <entry>strictredirects</entry>
                            <entry>Whether to strictly follow the RFC when redirecting (see <xref linkend="zend.http.client.redirections" />)</entry>
                            <entry>boolean</entry>
                            <entry>false</entry>
                        </row>
                        <row>
                            <entry>useragent</entry>
                            <entry>User agent identifier string (sent in request headers)</entry>
                            <entry>string</entry>
                            <entry>'Zend_Http_Client'</entry>
                        </row>
                        <row>
                            <entry>timeout</entry>
                            <entry>Connection timeout (seconds)</entry>
                            <entry>integer</entry>
                            <entry>10</entry>
                        </row>
                        <row>
                            <entry>httpversion</entry>
                            <entry>HTTP protocol version (usually '1.1' or '1.0')</entry>
                            <entry>string</entry>
                            <entry>'1.1'</entry>
                        </row>
                        <row>
                            <entry>adapter</entry>
                            <entry>Connection adapter class to use (see <xref linkend="zend.http.client.adapters" />)</entry>
                            <entry>mixed</entry>
                            <entry>'Zend_Http_Client_Adapter_Socket'</entry>
                        </row>
                        <row>
                            <entry>keepalive</entry>
                            <entry>Whether to enable keep-alive connections with the server. Useful and might improve performance if several
                            consecutive requests to the same server are performed.</entry>
                            <entry>boolean</entry>
                            <entry>false</entry>
                        </row>
                        <row>
                            <entry>storeresponse</entry>
                            <entry>Whether to store last response for later retrieval with getLastResponse(). If set to false
                            getLastResponse() will return null.</entry>
                            <entry>boolean</entry>
                            <entry>true</entry>
                        </row>
                    </tbody>
                </tgroup>
            </table>
        </para>
    </sect2>
    <sect2 id="zend.http.client.basic-requests">
        <title>Performing Basic HTTP Requests</title>
        <para>
            Performing simple HTTP requests is very easily done using the
            request() method, and rarely needs more than three lines of code:
            <example id="zend.http.client.basic-requests.example-1">
                <title>Performing a Simple GET Request</title>
                <programlisting role="php"><![CDATA[
$client = new Zend_Http_Client('http://example.org');
$response = $client->request();
]]>
                </programlisting>
            </example>
            The request() method takes one optional parameter - the request method.
            This can be either GET, POST, PUT, HEAD, DELETE, TRACE, OPTIONS or
            CONNECT as defined by the HTTP protocol
            <footnote>
              <para>
                See RFC 2616 - <ulink url="http://www.w3.org/Protocols/rfc2616/rfc2616.html" />.
              </para>
            </footnote>.
            For convenience, these are all defined as class constants:
            Zend_Http_Client::GET, Zend_Http_Client::POST and so on.
        </para>
        <para>
            If no method is specified, the method set by the last setMethod()
            call is used. If setMethod() was never called, the default request
            method is GET (see the above example).
{'fraction_non_alphanumeric': 0.09119700103412616, 'fraction_numerical': 0.005170630816959669, 'mean_word_length': 1.326417080138325, 'pattern_counts': {'":': 0, '<': 323, '<?xml version=': 0, '>': 337, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5214255', 'n_tokens_mistral': 3706, 'n_tokens_neox': 3501, 'n_words': 1056}