Skip to content

Commit d74a108

Browse files
committed
Merge pull request #7 from Nekland/feature/allow-string-body
Feature/allow string body
2 parents da95ad6 + 4c2e9d5 commit d74a108

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

lib/Nekland/BaseApi/Api/AbstractApi.php

+8-8
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,15 @@ public function setTransformer(TransformerInterface $transformer)
4949
/**
5050
* Execute a http get query
5151
*
52-
* @param string $path
53-
* @param array $body
54-
* @param array $headers
52+
* @param string $path
53+
* @param array|string $body
54+
* @param array $headers
5555
* @return array|mixed
5656
*/
57-
protected function get($path, array $body = [], array $headers = [])
57+
protected function get($path, $body = [], array $headers = [])
5858
{
5959
$client = $this->getClient();
60-
$request = $client::createRequest('GET', $path, $body, $headers);
60+
$request = AbstractHttpClient::createRequest('GET', $path, $body, $headers);
6161

6262
return $this->transformer->transform($client->send($request));
6363
}
@@ -73,7 +73,7 @@ protected function get($path, array $body = [], array $headers = [])
7373
protected function put($path, $body = [], array $headers = [])
7474
{
7575
$client = $this->getClient();
76-
$request = $client::createRequest('PUT', $path, $body, $headers);
76+
$request = AbstractHttpClient::createRequest('PUT', $path, $body, $headers);
7777

7878
return $this->transformer->transform($client->send($request));
7979
}
@@ -89,7 +89,7 @@ protected function put($path, $body = [], array $headers = [])
8989
protected function post($path, $body = [], array $headers = [])
9090
{
9191
$client = $this->getClient();
92-
$request = $client::createRequest('POST', $path, $body, $headers);
92+
$request = AbstractHttpClient::createRequest('POST', $path, $body, $headers);
9393

9494
return $this->transformer->transform($client->send($request));
9595
}
@@ -105,7 +105,7 @@ protected function post($path, $body = [], array $headers = [])
105105
protected function delete($path, $body = [], array $headers = [])
106106
{
107107
$client = $this->getClient();
108-
$request = $client::createRequest('DELETE', $path, $body, $headers);
108+
$request = AbstractHttpClient::createRequest('DELETE', $path, $body, $headers);
109109

110110
return $this->transformer->transform($client->send($request));
111111
}

0 commit comments

Comments
 (0)