Skip to content

Commit

Permalink
Make GET requests with query string
Browse files Browse the repository at this point in the history
  • Loading branch information
pinguinjkeke committed Mar 26, 2018
1 parent 9d1a6ae commit 9d2e15e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/Message/AbstractCurlRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -193,11 +193,13 @@ public function getHeaders(): array
public function sendData($data): ResponseInterface
{
$url = $this->getEndpoint() . $this->getMethod();

$httpResponse = $this->httpClient->post($url, $this->getHeaders(), array_merge([
$data = array_merge([
'userName' => $this->getUserName(),
'password' => $this->getPassword(),
], $data));
], $data);
$query = http_build_query($data, '', '&');

$httpResponse = $this->httpClient->get("{$url}?{$query}", $this->getHeaders());

$statusCode = $httpResponse->getStatusCode();

Expand Down

0 comments on commit 9d2e15e

Please sign in to comment.