Sie wollen dies:
curl_setopt($process, CURLOPT_USERPWD, $username . ":" . $password);
Zend hat eine REST-Client und Zend_Http_Client und ich bin sicher, dass PEAR eine Art Wrapper hat. Aber es ist einfach genug, auf eigene Faust zu tun.
So ist die gesamte Anfrage wie folgt aussehen könnte:
$process = curl_init($host);
curl_setopt($process, CURLOPT_HTTPHEADER, array('Content-Type: application/xml', $additionalHeaders));
curl_setopt($process, CURLOPT_HEADER, 1);
curl_setopt($process, CURLOPT_USERPWD, $username . ":" . $password);
curl_setopt($process, CURLOPT_TIMEOUT, 30);
curl_setopt($process, CURLOPT_POST, 1);
curl_setopt($process, CURLOPT_POSTFIELDS, $payloadName);
curl_setopt($process, CURLOPT_RETURNTRANSFER, TRUE);
$return = curl_exec($process);
curl_close($process);
Der Zend REST-Client ist hier: http://framework.zend.com/manual/en/zend .rest.client.html –
Cool danke Pekka –
@Pekka - Ihr Link ist kaputt, wie Sie http vermissen: // –