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

Issue Type: Docs: Improvement Created: 2010-08-12T08:44:07.000+0000 Last Updated: 2012-11-20T21:37:30.000+0000 Status: Open Fix version(s): Reporter: Joel A. Bair (joelbair) Assignee: None Tags: - Zend_Http_Client

Related issues: Attachments:


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.


<pre class="literal">

        $adapter = new Zend_Http_Client_Adapter_Curl();
            'curloptions' => array(
                CURLOPT_USERPWD     => "$username:$password"
        $client = new Zend_Http_Client();
        $client->setUri("http://<a href=""></a>");
        $response = $client->request();

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


No comments to display

Have you found an issue?

See the Overview section for more details.


© 2006-2018 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.