From 0be4887e7b3c481f300c1373ee57a7757835e05c Mon Sep 17 00:00:00 2001 From: aobukhov Date: Wed, 4 Jun 2014 20:52:07 +0400 Subject: [PATCH] Fix get payload --- src/LinguaLeo/wti/WtiRequestBuilder.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/LinguaLeo/wti/WtiRequestBuilder.php b/src/LinguaLeo/wti/WtiRequestBuilder.php index 635e18c..b3bfe4f 100644 --- a/src/LinguaLeo/wti/WtiRequestBuilder.php +++ b/src/LinguaLeo/wti/WtiRequestBuilder.php @@ -57,7 +57,11 @@ public function build() $params = $this->jsonEncodeParams ? json_encode($this->params) : $this->params; curl_setopt($this->resource, CURLOPT_POST, true); curl_setopt($this->resource, CURLOPT_POSTFIELDS, $params); + } else { + curl_setopt($this->resource, CURLOPT_POST, false); + curl_setopt($this->resource, CURLOPT_POSTFIELDS, []); } + curl_setopt($this->resource, CURLOPT_URL, $this->buildRequestUrl()); curl_setopt($this->resource, CURLOPT_RETURNTRANSFER, true); curl_setopt($this->resource, CURLOPT_HEADER, 1); @@ -95,4 +99,4 @@ private function buildUrlParams() return $params ? http_build_query($params) : []; } -} \ No newline at end of file +}