Permalink
Browse files

. Split of the line of the previou patch for readability

. Fixed coding standards with php-cs-fixer
  • Loading branch information...
1 parent 35209eb commit 5da05f5ac9e3a340199c5bd862bac0bf3165f6c1 Bruno CHALOPIN committed Jun 14, 2012
Showing with 10 additions and 2 deletions.
  1. +10 −2 Goutte/Client.php
View
@@ -16,7 +16,6 @@
use Guzzle\Http\Exception\CurlException;
use Guzzle\Http\Exception\BadResponseException;
-use Guzzle\Http\Message\RequestInterface as GuzzleRequestInterface;
use Guzzle\Http\Message\Response as GuzzleResponse;
use Guzzle\Http\ClientInterface as GuzzleClientInterface;
use Guzzle\Http\Client as GuzzleClient;
@@ -80,11 +79,20 @@ protected function doRequest($request)
}
}
+ $body = null;
+ if (!in_array($request->getMethod(), array('GET','HEAD'))) {
+ if (null !== $request->getContent()) {
+ $body = $request->getContent();
+ } else {
+ $body = $request->getParameters();
+ }
+ }
+
$guzzleRequest = $this->getClient()->createRequest(
$request->getMethod(),
$request->getUri(),
array_merge($this->headers, $headers),
- in_array($request->getMethod(), array('GET','HEAD')) ? null : null !== $request->getContent() ? $request->getContent() : $request->getParameters()
+ $body
);
if ($this->auth !== null) {

0 comments on commit 5da05f5

Please sign in to comment.