The only gotchas to handling headers is that some web servers are a little weird, like Lighttpd. cURL balks on Continue: headers from Lighttpd.
Is this where a 100 or 101 response code is returned? What's the correct way to handle this? Is CURLOPT_HTTP200ALIASES useful here?
You will need to define a headerfunc() for use in your cURL class/function/whatever. Then you use curl_setopt($ch, CURLOPT_HEADERFUNC, myHeaderFunc());
You will have to process *everything* a browser does in the headerfunc, including Location: directives, cookies, etc.
None of that is that hard, though.
I don't mind processing everything, - if I used CURLOPT_RETURNTRANSFER 1, CURLOPT_HEADER 1 and CURLOPT_BINARYTRANSFER 1 will this be the equivilant of a raw server response? Or is this where HEADERFUNC is better? i.e. it guarantees getting everything. Does the string thats passed to HEADERFUNC include the "body" of the server response? How does this work with complicated things like chunked stuff, or funny encodings?
Thanks for the ideas!
Steve