cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: How to send a form field value that begins with '@'?

From: Daniel Stenberg <daniel-curl_at_haxx.se>
Date: Sun, 6 Mar 2005 15:19:03 +0100 (CET)

On Sun, 6 Mar 2005, David Houlder wrote:

> OK. I think I was led astray by
> http://au2.php.net/manual/en/function.curl-setopt.php which seems to
> indicate that in php, curl_setopt($ch, CURLOPT_POSTFIELDS, $data) only does
> a multipart/form-data post if you use the '@file' feature. I assumed that
> behaviour was built into curl, but it must be just a php-ism.

Well, I believe you (or I) have misunderstood how the PHP/CURL binding works
in that aspect. I'm under the impression that if you pass in a hash array, it
does a multipart/form-data post, if you pass in a string it does a "normal"
post.

Either way, I think it is an odd choice. The actual underlying libcurl API
makes a much clearer distinction, IMHO.

-- 
      Daniel Stenberg -- http://curl.haxx.se -- http://daniel.haxx.se
       Dedicated custom curl help for hire: http://haxx.se/curl.html
Received on 2005-03-06