diff --git a/src/Http/PipedriveClient.php b/src/Http/PipedriveClient.php index 409a357..ae00bff 100644 --- a/src/Http/PipedriveClient.php +++ b/src/Http/PipedriveClient.php @@ -23,6 +23,8 @@ class PipedriveClient implements Client */ protected $isOauth = false; + const DEFAULT_BODY_FORMAT = RequestOptions::JSON; + /** * GuzzleClient constructor. * @@ -100,7 +102,7 @@ public function get($url, $parameters = []) public function post($url, $parameters = []) { $request = new GuzzleRequest('POST', $url); - $form = 'form_params'; + $form = self::DEFAULT_BODY_FORMAT; // If any file key is found, we will assume we have to convert the data // into the multipart array structure. Otherwise, we will perform the @@ -155,7 +157,7 @@ public function put($url, $parameters = []) { $request = new GuzzleRequest('PUT', $url); - return $this->execute($request, ['form_params' => $parameters]); + return $this->execute($request, [self::DEFAULT_BODY_FORMAT => $parameters]); } /** @@ -168,7 +170,7 @@ public function put($url, $parameters = []) public function patch($url, $parameters = []) { $request = new GuzzleRequest('PATCH', $url); - $form = 'form_params'; + $form = self::DEFAULT_BODY_FORMAT; // If any file key is found, we will assume we have to convert the data // into the multipart array structure. Otherwise, we will perform the @@ -197,7 +199,7 @@ public function delete($url, $parameters = []) { $request = new GuzzleRequest('DELETE', $url); - return $this->execute($request, ['form_params' => $parameters]); + return $this->execute($request, [self::DEFAULT_BODY_FORMAT => $parameters]); } /**