<commit_before><?xml version="1.0" encoding="UTF-8"?>
<!-- Reviewed: no -->
<sect1 id="zend.http.response">
    <title>Zend_Http_Response</title>

    <sect2 id="zend.http.response.introduction">
        <title>Introduction</title>
        <para>
            <classname>Zend_Http_Response</classname> provides easy access to an <acronym>HTTP</acronym> responses
            message, as well as a set of static methods for parsing <acronym>HTTP</acronym>
            response messages. Usually, <classname>Zend_Http_Response</classname> is used as an object
            returned by a <classname>Zend_Http_Client</classname> request.
        </para>
        <para>
            In most cases, a Zend_Http_Response object will be instantiated
            using the factory() method, which reads a string containing an HTTP
            response message, and returns a new Zend_Http_Response object:
            <example id="zend.http.response.introduction.example-1">
                <title>Instantiating a Zend_Http_Response Object Using the Factory Method</title>
                <programlisting language="php"><![CDATA[
$str = '';
$sock = fsockopen('www.example.com', 80);
$req =     "GET / HTTP/1.1\r\n" .
        "Host: www.example.com\r\n" .
        "Connection: close\r\n" .
        "\r\n";

fwrite($sock, $req);
while ($buff = fread($sock, 1024))
    $str .= $sock;

$response = Zend_Http_Response::factory($str);
]]></programlisting>
            </example>
        </para>
        <para>
            You can also use the contractor method to create a new response
            object, by specifying all the parameters of the response:<commit_msg>Fixing incorrect reference to ::factory() method (ZF-8719, <NAME>)<commit_after><?xml version="1.0" encoding="UTF-8"?>
<!-- Reviewed: no -->
<sect1 id="zend.http.response">
    <title>Zend_Http_Response</title>

    <sect2 id="zend.http.response.introduction">
        <title>Introduction</title>
        <para>
            <classname>Zend_Http_Response</classname> provides easy access to an <acronym>HTTP</acronym> responses
            message, as well as a set of static methods for parsing <acronym>HTTP</acronym>
            response messages. Usually, <classname>Zend_Http_Response</classname> is used as an object
            returned by a <classname>Zend_Http_Client</classname> request.
        </para>
        <para>
            In most cases, a Zend_Http_Response object will be instantiated
            using the fromString() method, which reads a string containing an HTTP
            response message, and returns a new Zend_Http_Response object:
            <example id="zend.http.response.introduction.example-1">
                <title>Instantiating a Zend_Http_Response Object Using the Factory Method</title>
                <programlisting language="php"><![CDATA[
$str = '';
$sock = fsockopen('www.example.com', 80);
$req =     "GET / HTTP/1.1\r\n" .
        "Host: www.example.com\r\n" .
        "Connection: close\r\n" .
        "\r\n";

fwrite($sock, $req);
while ($buff = fread($sock, 1024))
    $str .= $sock;

$response = Zend_Http_Response::fromString($str);
]]></programlisting>
            </example>
        </para>
        <para>
            You can also use the contractor method to create a new response
            object, by specifying all the parameters of the response:
{'fraction_non_alphanumeric': 0.12272862675007447, 'fraction_numerical': 0.009532320524277629, 'mean_word_length': 2.686059275521405, 'pattern_counts': {'":': 0, '<': 64, '<?xml version=': 2, '>': 64, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 2}, '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': '7318758', 'n_tokens_mistral': 1009, 'n_tokens_neox': 962, 'n_words': 276}