curl-and-php
Re: reviewing headers and output
Date: Fri, 28 Nov 2003 21:50:46 +0100 (CET)
On Fri, 28 Nov 2003, Stephen Buckley wrote:
> I was wondering if there is 'best' method for reviewing the header
> information and output that gets cURLed. Currently, to confirm cURLed
> output, I will cURL to a page that has these lines has these lines in it:
>
> echo "Server Response: <p>\n: ".$_POST."<p>\n";
> print_r($_POST); // the output is an array
I'll repeat what I always say here:
Use the command line tool to first work out how to curl, then convert that
to PHP functions.
Using the command line tool, use -v and --trace to get to see every tiny byte
from the transactions.
(libcurl offers both CURLOPT_VERBOSE and the more detailed
CURLOPT_DEBUGFUNCTION to get this functionality, but the PHP layer doesn't
really offer any good usage of these.)
> Sometimes it is fine, but sometimes I will get completely nothing, knowing
> full well that data is being sent; plus this would only reply the data and
> no header information. I feel like, there has to be a better and more
> accurate way to achieve this, yes?
Another approach is to use a network analyzer tool, such as ethereal.
-- Daniel Stenberg -- http://curl.haxx.se/ -- http://daniel.haxx.se/ [[ Do not post private mails to this email address. They won't reach me. ]] ------------------------------------------------------- This SF.net email is sponsored by: SF.net Giveback Program. Does SourceForge.net help you be more productive? Does it help you create better code? SHARE THE LOVE, and help us help YOU! Click Here: http://sourceforge.net/donate/Received on 2003-11-28