warnockm Posted November 8, 2006 Share Posted November 8, 2006 i'm trying to use php and CURL to view the header to get the content-type and the file data. I use the curl option: CURLOPT_HEADER true to see the header, but i want to get the file data and header separately. is that possible? Quote Link to comment Share on other sites More sharing options...
joshi_v Posted November 8, 2006 Share Posted November 8, 2006 Use 'url_multi_getcontent' . it will returns the content of a cURL handle if CURLOPT_RETURNTRANSFER is set Regards,Joshi. Quote Link to comment Share on other sites More sharing options...
warnockm Posted November 10, 2006 Author Share Posted November 10, 2006 and is that the header and content separately? That feature isn't documented. Quote Link to comment Share on other sites More sharing options...
exoskeleton Posted November 10, 2006 Share Posted November 10, 2006 i think CURLOPT_HEADER is a BUG see this: http://bugs.php.net/bug.php?id=10211&edit=2 Quote Link to comment Share on other sites More sharing options...
joshi_v Posted November 10, 2006 Share Posted November 10, 2006 Yeah! you are right.This function is not yet documented..but as much as i know it will return only contents of the URL. Have it a try!Regards,Joshi. Quote Link to comment Share on other sites More sharing options...
warnockm Posted November 10, 2006 Author Share Posted November 10, 2006 i think the CURL_HEADER bug report is pretty old. I've had success using CURL_HEADER, however, all it does is puts the header in w/ the data, so you get:Content-type: text/html... etc at the top, and then the response <html>... etcafter that. Someone wrote something the separates the responses. apparently its just 2 new lines/carriage returns:http://us2.php.net/manual/en/function.curl-setopt.php#44986. I was hoping to have it built into the CURL functions, since i can't see how having the header and response in the same would be that useful. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.