Note that there are some explanatory texts on larger screens.

plurals
  1. POauthentication using Zend_Http_Client
    primarykey
    data
    text
    <p>I'm trying to use Zend_Http_Client to make a simple post request on a site that requires authentication. Everything seems to be correct but I'm still getting a <code>You are not authorized to view this page</code> error. Any ideas what the problem might be? I'm certain the username and password are correct</p> <pre><code> $client = new \Zend_Http_Client('http://ncmcrm/sales_summary/activity_range.asp'); $client-&gt;setHeaders('WWW-Authenticate', 'Negotiate'); $client-&gt;setParameterPost(array( 'from_day' =&gt; 1, 'from_month' =&gt; 1, 'from_year' =&gt; 2012, 'to_day' =&gt; 31, 'to_month' =&gt; 1, 'to_year' =&gt; 2012, 'user_id' =&gt; '{BCDF3313-9DBA-40E7-9CD8-02332F72A64F}' )); $client-&gt;setAuth('******', '*****', \Zend_Http_Client::AUTH_BASIC); $response = $client-&gt;request('POST'); print_r($response-&gt;getBody()); </code></pre> <p>Here's what I get in Firebug for the POST request that I'm interested in:</p> <pre><code>Response Headers Connection close Content-Length 4431 Content-Type text/html Date Thu, 08 Mar 2012 19:13:11 GMT Server Microsoft-IIS/5.0 WWW-Authenticate Negotiate NTLM Request Headers Accept text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Encoding gzip, deflate Accept-Language en-us,en;q=0.5 Connection keep-alive Content-Length 120 Content-Type application/x-www-form-urlencoded; charset=UTF-8 Cookie ASPSESSIONIDAAQSBCBQ=FEEOKMDAANCMKLGBKDBNKLHE Host ncmcrm Referer http://ncmcrm/sales_summary/sales_summary.asp User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:10.0.2) Gecko/20100101 Firefox/10.0.2 </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload