我正在使用PHP和cURL
将HTTP请求发送到REST API。但是,我需要验证进/出的一些数据。
如何获取登录到文件中的整个请求的副本?
我已将此行添加到我的请求中
curl_setopt($ch, CURLOPT_VERBOSE, true);
我希望我可以将副本看起来像这样保存到日志文件中。
--- START REQUEST
POST /icws/3048186002/interactions/3002853105 HTTP/1.1
Host: servername:8018
Accept: */*
Cookie: icws_3048186002=64425290-29e5-432a-9ee1-c303cdee1f79
ININ-ICWS-CSRF-Token: WAp3cmF0Y2xpZmZlWBJJQ1dTLUFQSS1jb25uZWN0b3JYJGQwYjhlMWRhLTZlOTktNGIwMC05NGNlLTY5MDdkZjUwOWI5Y1gJMTAuMC40LjE4
ININ-ICWS-Session-ID: 3048186002
Content-Type: application/json
Content-Length: 35
{"attributes":{"logged":1}}
--- END REQUEST
--- START RESPOND
HTTP/1.1 200 OK
Cache-Control: no-cache, no-store, must-revalidate
Pragma: no-cache
Expires: 0
Access-Control-Allow-Origin: *
Access-Control-Allow-Credentials: true
Content-Type: application/vnd.inin.icws+JSON; charset=utf-8
Date: Wed, 02 Sep 2015 20:39:26 GMT
Server: HttpPluginHost
Content-Length: 0
--- END RESPOND
如何在不使用WireShark的情况下捕获此数据?我认为cURL和PHP足够先进,可以让你记录这样的东西。