Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Gianluca Dal Pont committed Mar 17, 2023
1 parent 8c1987c commit 03bd0ee
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 9 deletions.
27 changes: 19 additions & 8 deletions client/src/Rest/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,25 @@ public function request($method, $uri, $headers = [], $params = [])
$headers['Accept'] = 'application/json';
//}

$response = $this->httpClient->request(
$method,
$uri,[
'auth' => [$this->authKey, $this->authSecret],
'headers' => $headers,
'query' => $params
],
);
if ($method === 'POST'|| $method === 'PUT') {
$response = $this->httpClient->request(
$method,
$uri,[
'auth' => [$this->authKey, $this->authSecret],
'headers' => $headers,
'form_params' => $params
],
);
}else {
$response = $this->httpClient->request(
$method,
$uri,[
'auth' => [$this->authKey, $this->authSecret],
'headers' => $headers,
'query' => $params
],
);
}

return $response;
}
Expand Down
2 changes: 1 addition & 1 deletion client/src/Rest/Sms.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function cancel($params = [])

public function search($params = [])
{
$this->url = 'search';
$this->uri = 'search';
return $this->client->request('GET', $this->buildUri($this->service, $this->uri), $headers = [], $params);
}
}
Expand Down

0 comments on commit 03bd0ee

Please sign in to comment.