Hello,

On 01/30/2004 05:31 PM, Kristopher Spencer-Yates wrote:
Normally I wouldn't do this but the cURL list seems to be in severe hibernation, ie. no activity. I'm in a bit of a jam w/ this and so here goes....

How do I get cURL to pass headers properly? It is ignoring my -H headers and sending its own default or whatever set of headers. One example, it submits as x-www-urlencoded-form or whatever but I want it to just send -H "my headers!". Can anyone point me in the right direction? I know I probably just need to change something simple here.. see below:

<?
$mime_headers="POST /AUTHORIZE HTTP/1.0\nMIME-Version: 1.0\nContent-type: application/X1";


$xml_content="{some XML - use your imagination here}";

exec("/usr/local/bin/curl -m 120 -H \"$mime_headers\" -d \"$xml_content\"
$merchant_URL:$merchant_PORT -L", $return_message_array, $return_number);
?>

You do not need to call cURL external program to send an HTTP request. You can use fsockopen connections.


You may want to try this HTTP client class. It actually uses curl extension but only for secure connections (SSL/HTTPS). For normal HTTP connections it uses fsockopen. It can send POST requests including those tha need to send XML data like SOAP requests. So you can do what you want with this class:

http://www.phpclasses.org/httpclient

--

Regards,
Manuel Lemos

Free ready to use OOP components written in PHP
http://www.phpclasses.org/

MetaL - XML based meta-programming language
http://www.meta-language.net/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to