我正在使用Guzzle做cUrl请求。
$client = new GuzzleHttp\Client();
try {
$response = $client->get($url);
} catch (\GuzzleHttp\Exception\RequestException $ex) {
// handle error.
}
服务器响应的格式如下:
"field1","field2","field3"\n
"value1","value2","value3"\n
"value4","","value5"\n
使用GuzzleHttp \ Client,我收到以下响应正文
"field1","field2","field3""value1","value2","value3""value4","","value5"\n
是否可以将Guzzle客户端设置为不替换响应正文中的换行符?
答案 0 :(得分:0)
在出现这两个细节的情况下,我不得不猜测你可能需要实现某种类型的stream decorator,这样一次只能读入一行响应。