Skip to content
This repository has been archived by the owner on Oct 22, 2021. It is now read-only.

Commit

Permalink
Merge pull request #26 from cloudflare/thellimist/PI-785
Browse files Browse the repository at this point in the history
PI-789 fixed method for Guzzle setBody
  • Loading branch information
thellimist authored Sep 12, 2016
2 parents 1e030e5 + 7bd8549 commit 2b6b027
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/API/AbstractAPIClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ public function callAPI(Request $request)
$method = $request->getMethod();

// Since Guzzle automatically overwrites a new header when the request
// is POST / PATCH / DELETE, we need to overwrite the Content-Type header
// is POST / PATCH / DELETE / PUT, we need to overwrite the Content-Type header
// with setBody() function.
if ($method === 'PATCH' || $method === 'DELETE' || $method === 'POST') {
if ($method !== 'GET') {
$apiRequest->setBody(json_encode($request->getBody()), 'application/json');
}

Expand Down

0 comments on commit 2b6b027

Please sign in to comment.