Skip to content

Commit ecc2e32

Browse files
committed
Use body instead of query, ref #13 and #8
1 parent 8ff0e4b commit ecc2e32

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/Stichoza/GoogleTranslate/TranslateClient.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,9 +186,9 @@ public function getResponse($string) {
186186
]);
187187

188188
try {
189-
$response = $this->httpClient->post($this->urlBase, ['query' => $queryArray]);
189+
$response = $this->httpClient->post($this->urlBase, ['body' => $queryArray]);
190190
} catch (GuzzleRequestException $e) {
191-
throw new ErrorException("Error processing request");
191+
throw new ErrorException($e->getMessage());
192192
}
193193

194194
$body = $response->getBody(); // Get response body

0 commit comments

Comments
 (0)