有没有办法查看 HttpSocket->get()
中发送的原始数据?我收到服务器的响应,但我无法判断我发送的 header 格式是否正确,或者是否发送了任何我需要覆盖的默认 header 。
$options = array(
'header' => array(
'OSLC-Core-Version' => '2.0',
'Accept' => 'application/xml'
)
);
$HttpSocket = new HttpSocket();
$results = $HttpSocket->get($url, null, $options);
返回的数据包含原始返回信息,我正在寻找一种方法在将原始数据发送到远程服务器之前对其进行调试。
谢谢
最佳答案
您可以在 HttpSocket::$request
中找到上次请求的所有详细信息(包括 header ) .
$HttpSocket = new HttpSocket();
$results = $HttpSocket->get($url, null, $options);
debug($HttpSocket->request);
关于cakephp - 调试在 get 中发送的 CakePHP HttpSocket 数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18190293/