Skip to content
This repository has been archived by the owner on Nov 2, 2022. It is now read-only.

Commit

Permalink
Fixed PUT requests
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesryanbell committed Apr 16, 2016
1 parent 60f7ca4 commit 0e31d13
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/CloudFlare/Api.php
Original file line number Diff line number Diff line change
Expand Up @@ -222,13 +222,10 @@ protected function request($path, array $data = null, $method = null, $permissio

if($method === 'post') {
curl_setopt($ch, CURLOPT_POST, true);
//curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
} else if ($method === 'put') {
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT");
//curl_setopt($ch, CURLOPT_HTTPHEADER, array('X-HTTP-Method-Override: PUT'));
$headers[] = "Content-type: application/json";
} else if ($method === 'delete') {
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
Expand Down

0 comments on commit 0e31d13

Please sign in to comment.