Re: CURL file posting

From: Date: Wed, 02 Jan 2013 16:05:35 +0000
Subject: Re: CURL file posting
References: 1 2 3 4 5 6 7 8 9  Groups: php.internals 
Request: Send a blank email to internals+get-64476@lists.php.net to get a copy of this message
On Wed, Jan 2, 2013 at 8:39 AM, Johannes Schlüter <johannes@schlueters.de> wrote: > Stas Malyshev <smalyshev@sugarcrm.com> wrote: > >I'm thinking maybe the best solution is to have a new class - say, > >CurlFile - and do this: > > > >$file = new CurlFile("myface.png", "image/png"); > >curl_setopt($ch, CURLOPT_POSTFIELDS, array("foo" => "bar", > >"picture" => > >$file); > > What I wonder about in this thread: If we struggle here why not take the > full step and abstract curl details comletely away and provide something > like pecl/http by default instead? Personally I've always hated using the cURL API in PHP and would love to see a solid implementation included by default, but I would guess that the general consensus would be that it could/should be done in user-land. Anyone know if Guzzle (http://guzzlephp.org/) handles this? I know it's a popular HTTP client for PHP and is included in the Amazon Web Service SDK (https://github.com/aws/aws-sdk-php).

« previous php.internals (#64476) next »