How to view full request headers , including post data , using libcurl in php?
I am trying to simulate a page message which, when it is made from a browser and viewed in Live HTTP Headers, looks like this:
https://###.com POST /###/### HTTP/1.1 Host: ###.###.com ...snipped normal looking headers... Content-Type: multipart/form-data; boundary=---------------------------28001808731060 Content-Length: 697 -----------------------------28001808731060 Content-Disposition: form-data; name="file_data"; filename="stats.csv" Content-Type: text/csv id,stats_id,scope_id,stat_begin,stat_end,value 61281,1,4,2011-01-01 00:00:00,2011-12-31 23:59:59,0 -----------------------------28001808731060 Content-Disposition: form-data; name="-save" Submit -----------------------------28001808731060--
So, we can clearly see the file I'm downloading, this is the content, everything is there. But all my attempts to get data from cURL when I try to make the same post from php (using CURLOPT_VERBOSE or CURLINFO_HEADER_OUT ) display request headers that do not have mail data, for example:
POST /###/.
Based on the Content-Length here, everything seems to be going well, but that would really help my debugging efforts to see the full request. I am also annoyed that it is difficult; I must be able to see all this; I know that something is missing me.
--- EDIT ---
What I'm looking for is equivalent to this :
curl --trace-ascii debugdump.txt http:
which is apparently available with the CURLOPT_DEBUGFUNCTION option in libcurl but not implemented in php. Boo.
Chris
source share