I'm trying to fetch a CSV file from a remote server and download it Using Zend_Http_Client
The fetched version has all of the newlines removed.
require_once('Zend/Http/Client.php');
$client = new Zend_Http_Client($url);
//also tried the curl adapter but no change
$client->setCookieJar();
$client->setAuth('user', 'pass', Zend_Http_Client :: AUTH_BASIC);
if(!empty($params)){
$client->setParameterGet($params);
}
$client->request();
$request = $client->getLastRequest();
$response = $client->getLastResponse();
echo $response->getRawBody();
The response is all one line.
If I fetch the $url
with curl it is on separate lines.
Also, I am looking at the source, not the HTML rendered version
UPDATE
So I rewrote that bit using cURL and it still does the same thing !?
if(!empty($params)){
$queryString = http_build_query($params);
$url.='?'.$queryString;
}
$ch = curl_init($url);
curl_setopt($ch,CURLOPT_USERPWD,"$username:$password");
curl_exec($ch);
Any ideas