开发者

HTTP Authentication with PHP's Zend XML RPC Client

开发者 https://www.devze.com 2022-12-23 12:19 出处:网络
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 a开发者_如何学Cuthentication. How can I t

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 a开发者_如何学Cuthentication. How can I tell the XMLRPC client to use authentication for the requests?


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);
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号