cURL / Mailing Lists / curl-and-php / Single Mail

curl-and-php

multipart/form-data POST problem with php 4.0.6

From: Axel Suppantschitsch <axel_at_swb-consulting.com>
Date: Fri, 2 Nov 2001 17:11:56 -0800

Hey,

        I need to do a HTTP POST to a https:// link, posting several
fields with affiliated values. The destination url is a cgi script which
has some problems with the data, especially with the boundaries as I
assume. As I only transmit data from text fields, the normal post
operation would be sufficient.

I'm initializing curl with following switches:

$ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $post_url);
    curl_setopt($ch, CURLOPT_HEADER, 0);
    curl_setopt($ch, CURLOPT_VERBOSE, 0);
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields);

$postfields is an array, $post_url contains the https://***.cgi link.

Though I set CURLOPT_POST to 1, it still uses multipart/form-data.
I'm using PHP 4.0.6 with curl-ssl-devel-7.9-1rh71.i386.rpm compiled into
PHP using the --with-curl switch.

Any suggestions?

Regards,

Axel Suppantschitsch|Software Development
SWB Consulting Inc. World Headquarters
575 Harrison Street, Suite 303|San Francisco,CA 94105|U.S.
phone/fax: ++1(415) 543-5825
email: axel_at_swb-consulting.com
web: www.swb-consulting.com
Received on 2001-11-03