Skip to content

Commit

Permalink
add http_build_query to POST, fixes #39
Browse files Browse the repository at this point in the history
  • Loading branch information
dirkgroenen committed Feb 11, 2016
1 parent 975c69f commit e3a0cfd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions demo/callback.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'
));
?>

</body>
Expand Down
2 changes: 1 addition & 1 deletion src/Pinterest/Transport/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -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')) {
Expand Down

0 comments on commit e3a0cfd

Please sign in to comment.