调试CakePHP在get中发送的HttpSocket数据

Ste*_*ere 2 cakephp http-get cakephp-2.0

有没有办法看到原始数据被发送HttpSocket->get()?我从服务器得到响应,但我无法判断我发送的标头是否格式正确,或者是否有任何我需要覆盖的默认标头.

$options = array(
  'header' => array(
    'OSLC-Core-Version' => '2.0',
    'Accept' => 'application/xml'
  )
);

$HttpSocket = new HttpSocket();
$results = $HttpSocket->get($url, null, $options);
Run Code Online (Sandbox Code Playgroud)

返回的数据包含原始返回的信息,我正在寻找一种方法来调试原始数据,然后再将其发送到远程服务器.

谢谢

ndm*_*ndm 6

您可以在中找到最后一个请求的所有详细信息(包括标题)HttpSocket::$request.

$HttpSocket = new HttpSocket();
$results = $HttpSocket->get($url, null, $options);

debug($HttpSocket->request);
Run Code Online (Sandbox Code Playgroud)