#50459 [Opn]: CURLINFO_HEADER_OUT does not work

From: Date: Sat, 12 Dec 2009 16:20:47 +0000
Subject: #50459 [Opn]: CURLINFO_HEADER_OUT does not work
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-3461@lists.php.net to get a copy of this message
ID: 50459 Updated by: felipe@php.net Reported By: tony at marston-home dot demon dot co dot uk Status: Open -Bug Type: cURL related +Bug Type: Documentation problem Operating System: Windows XP PHP Version: 5.3.1 New Comment: Read this user note: http://docs.php.net/manual/en/function.curl-getinfo.php#83898 "[...] if you want to use curl_getinfo() with option CURLINFO_HEADER_OUT in order to debug your cURL request, you must add curl_setopt($handle, CURLINFO_HEADER_OUT, true); [...]" Changed category to "Documentation problem", as this constant also isn't mentioned in the curl_setopt() doc page. Previous Comments: ------------------------------------------------------------------------ [2009-12-12 15:38:49] tony at marston-home dot demon dot co dot uk Description: ------------ The following line always returns FALSE: $info = curl_getinfo($ch, CURLINFO_HEADER_OUT); Reproduce code: --------------- $request = <<<EOD <?xml version="1.0" encoding="UTF-8"?> <methodCall> <methodName>menu.getAnswer</methodName> <params/> </methodCall> EOD; $header[] = "Content-type: text/xml"; $header[] = "User-Agent: foobar"; $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, $header); curl_setopt($ch, CURLOPT_HEADER, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $request); $response = curl_exec($ch); $info = curl_getinfo($ch, CURLINFO_HEADER_OUT); Expected result: ---------------- According to the documentation this option has been available since version 5.1.3, so I expect to see the request headers which were sent out. Actual result: -------------- The result is always FALSE. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=50459&edit=1

« previous php.doc.bugs (#3461) next »