diff --git a/demo/callback.php b/demo/callback.php index c735a20..ff1bf54 100644 --- a/demo/callback.php +++ b/demo/callback.php @@ -10,9 +10,12 @@ "description" => "Test" ));*/ - echo $pinterest->boards->edit("dirkgroenen/test-from-api", array( - "name" => "Noted update 2 - API" - ), "id,name,url,description,creator,created_at,counts,image"); + echo $pinterest->pins->create(array( + "board" => "dirkgroenen/test-from-api", + 'image_url' => 'https://images.unsplash.com/photo-1453974336165-b5c58464f1ed?crop=entropy&fit=crop&fm=jpg&h=1000&ixjsv=2.1.0&ixlib=rb-0.3.5&q=80&w=1925', + 'note' => 'test', + 'link' => 'http://tld.com/072AE601DF7DB00445386F5C9CC46F74' + )); ?> diff --git a/src/Pinterest/Transport/Request.php b/src/Pinterest/Transport/Request.php index dee632e..aec9b78 100644 --- a/src/Pinterest/Transport/Request.php +++ b/src/Pinterest/Transport/Request.php @@ -181,7 +181,7 @@ public function execute($method, $apiCall, array $parameters = array(), $headers $ch->setOptions(array( CURLOPT_CUSTOMREQUEST => "POST", CURLOPT_POST => count($parameters), - CURLOPT_POSTFIELDS => $parameters + CURLOPT_POSTFIELDS => http_build_query($parameters) )); if (!class_exists("\CURLFile") && defined('CURLOPT_SAFE_UPLOAD')) {