Skip to content

Commit 637386d

Browse files
committed
Update CurlRequest.php
1 parent 3aca224 commit 637386d

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/CurlRequest.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,9 @@ public function prepareSend(): CurlRequest
5353
$ch = $this->getCh();
5454
$method = $this->getMethod();
5555
$uri = $this->getUri();
56-
56+
5757
// добавляем данные запроса
58-
if ('GET' === $method) {
59-
$body = $this->getQuery();
60-
$uri .= static::prepareDataToUriQuery($body);
61-
} else {
58+
if ('GET' !== $method) {
6259
$type = $this->getHeader('Content-Type');
6360
if (false !== strpos($type, 'application/json')) {
6461
$this->withBodyJson($this->getBody());
@@ -80,7 +77,9 @@ public function prepareSend(): CurlRequest
8077
$this->withHeader('Cookie', implode(';', $cookies));
8178
}
8279
$headers = $this->getHeadersLines();
80+
8381
// устанавливаем url и заголовки
82+
$uri .= static::prepareDataToUriQuery($this->getQuery());
8483
curl_setopt($ch, CURLOPT_URL, $uri);
8584
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
8685
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);

0 commit comments

Comments
 (0)