How to get HTTP response body without headers
Posted: Fri Feb 25, 2005 11:13 am
Hi All,
I've been trying to retrieve HTTP response data using the following:
while(!feof){
$response[i++]=fgets($socket);
}
However this only allows me to get the data line by line. Unfortunately this method retrieves the header information before getting the actual data that I need in the HTTP response (i.e. the 'body'). Is there any way that I can retrieve the 'body' directly without having to read the header information first?
Thanks.
I've been trying to retrieve HTTP response data using the following:
while(!feof){
$response[i++]=fgets($socket);
}
However this only allows me to get the data line by line. Unfortunately this method retrieves the header information before getting the actual data that I need in the HTTP response (i.e. the 'body'). Is there any way that I can retrieve the 'body' directly without having to read the header information first?
Thanks.