From ecc2e329c39f164b9600a37eb4febf9763b4e9fb Mon Sep 17 00:00:00 2001 From: Levan Velijanashvili Date: Thu, 19 Mar 2015 01:56:43 +0400 Subject: [PATCH] Use body instead of query, ref #13 and #8 --- src/Stichoza/GoogleTranslate/TranslateClient.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Stichoza/GoogleTranslate/TranslateClient.php b/src/Stichoza/GoogleTranslate/TranslateClient.php index fc996c0..d6d3bc5 100644 --- a/src/Stichoza/GoogleTranslate/TranslateClient.php +++ b/src/Stichoza/GoogleTranslate/TranslateClient.php @@ -186,9 +186,9 @@ public function getResponse($string) { ]); try { - $response = $this->httpClient->post($this->urlBase, ['query' => $queryArray]); + $response = $this->httpClient->post($this->urlBase, ['body' => $queryArray]); } catch (GuzzleRequestException $e) { - throw new ErrorException("Error processing request"); + throw new ErrorException($e->getMessage()); } $body = $response->getBody(); // Get response body