Re: posting with cURL problem
- From: "zorro" <myahact@xxxxxxxx>
- Date: 29 Dec 2006 10:55:53 -0800
zorro wrote:
it doesn't work :
curl_setopt($curl, CURLOPT_POSTFIELDS, array('clown'=>'bozo') );
Benjamin wrote:
CURLOPT_POSTFIELDS only takes a string as it's parameter
I didn't find any specification stating that it takes a string
parameter.
http://www.php.net/manual/en/function.curl-setopt.php
There are dozens of examples where a string or an array is used and i
have also tried both successfully. The problem is only on this one
particular web site I'm posting to.
I need to use an array and not a string because for posting a file
upload one needs to use this syntax:
curl_setopt($curl, CURLOPT_POSTFIELDS,
array('mypic'=>"@path/to/image.gif") );
I tested that this works on my localhost and online testing server.
.
- References:
- posting with cURL problem
- From: zorro
- Re: posting with cURL problem
- From: Benjamin
- posting with cURL problem
- Prev by Date: Poogle caming !
- Next by Date: Re: posting with cURL problem
- Previous by thread: Re: posting with cURL problem
- Next by thread: Re: posting with cURL problem
- Index(es):
Relevant Pages
|