1

I am using the Zend library's XML RPC Client in a PHP application to pull data from another server over XML RPC. However the other server is using HTTP basic authentication. How can I tell the XMLRPC client to use authentication for the requests?

Charles
  • 50,943
  • 13
  • 104
  • 142
Amandasaurus
  • 58,203
  • 71
  • 188
  • 248

1 Answers1

4

Zend_XmlRpc_Client internally uses a Zend_Http_Client which handles the basic HTTP communication. You can retrieve the HTTP client with:

$httpClient = $rpcClient->getHttpClient();

and then you can set the requires authentication parameters:

$httpClient->setAuth($username, $password, Zend_Http_Client::AUTH_BASIC);
Stefan Gehrig
  • 82,642
  • 24
  • 155
  • 189