ZF-10302: Zend_Http_Client - Advanced Usage - HTTP Authentication (Digest)


The documentation rather directly implies that one cannot use Zend_Http_Client with a DIGEST auth scheme.…

{quote} HTTP Authentication

Currently, Zend_Http_Client only supports basic HTTP authentication. This feature is utilized using the setAuth() method, or by specifying a username and a password in the URI. The setAuth() method... {quote}

This is rather misleading, if not completely a misnomer. As Zend_Http_Client fully supports the php's cURL library, one can simply configure Zend_Http_Client with the cURL Adapter (Zend_Http_Client_Adapter_Curl).

What is technically correct, is that the public method setAuth() of Zend_Http_Client only supports BASIC. Not the entire Zend_Http_Client utility - as implied.

This needs to be stated much more clearly. Development efforts are taking alternate platform / framework direction based on the sentence in question. Obviously, if the reader continues on, and is familiar w/ cURL in PHP, this fact can be discovered. However, the simple statement "Zend_Http_Client only supports basic HTTP authentication" stands out and can cause the reader to stop there - feeling the the statement is final.


        $adapter = new Zend_Http_Client_Adapter_Curl();
            'curloptions' => array(
                CURLOPT_USERPWD     => "$username:$password"
        $client = new Zend_Http_Client();
        $response = $client->request();

This simple example of digest Authentication w/ the curl adapter should be included in the documentation.


No comments to display