Skip to content

Commit

Permalink
Release 1.1.6: Set HTTP request method even if request body is empty.
Browse files Browse the repository at this point in the history
  • Loading branch information
Rick Wong committed Oct 8, 2014
1 parent 4855993 commit 2e379ac
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mollie/mollie-api-php",
"version": "1.1.5",
"version": "1.1.6",
"description": "Mollie API client library for PHP",
"homepage": "https://github.com/mollie/mollie-api-php",
"license": "BSD-2-Clause",
Expand Down
14 changes: 4 additions & 10 deletions src/Mollie/API/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class Mollie_API_Client
/**
* Version of our client.
*/
const CLIENT_VERSION = "1.1.5";
const CLIENT_VERSION = "1.1.6";

/**
* Endpoint of the remote API.
Expand Down Expand Up @@ -188,18 +188,12 @@ public function performHttpCall ($http_method, $api_method, $http_body = NULL)
"X-Mollie-Client-Info: " . php_uname(),
);

curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $http_method);

if ($http_body !== NULL)
{
$request_headers[] = "Content-Type: application/json";

if ($http_method == self::HTTP_POST)
{
curl_setopt($ch, CURLOPT_POST, 1);
}
else
{
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $http_method);
}
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $http_body);
}

Expand Down

0 comments on commit 2e379ac

Please sign in to comment.