I’m using cURL to send a request to another webserver.
This is the code I’m using to setup and send the request:
function currentStatePlaying($ip){
$url = "http://".$ip."/?track=ginfo";
$agent= 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.0.3705; .NET CLR 1.1.4322)';
$ch = curl_init();
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_VERBOSE, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERAGENT, $agent);
curl_setopt($ch, CURLOPT_URL,$url);
$result = curl_exec($ch);
curl_close($ch);
echo $result;
}
I notice that the result is empty, when looking at a networkcapture made with wireshark I can see the response I need. It’s embedded inside the httppacket as Line-based text data: text/html
So my question to you is:
how can I access this data?
EDIT:
here is a screenshot of my packet:

The response from your server is not properly formed. It should be something like this:
By having
curl_setopt(CURLOPT_VERBOSE, 1)you have already enabled debug mode in cURL, but perhaps you should also havecurl_setopt(CURLOPT_STDERR, "php://output")Do let me know if the response can’t be changed (which is pretty bad).