|
@@ 132-138 (lines=7) @@
|
| 129 |
|
}); |
| 130 |
|
} |
| 131 |
|
|
| 132 |
|
private function post(Request $request): Promise |
| 133 |
|
{ |
| 134 |
|
$header = $this->getHeader('POST', $request->getEndpoint(), ...$request->getParameters()); |
| 135 |
|
$response = $this->httpClient->post($request->getEndpoint(), $header, new Body(...$request->getParameters())); |
| 136 |
|
|
| 137 |
|
return $this->handleResponse($response); |
| 138 |
|
} |
| 139 |
|
|
| 140 |
|
private function get(Request $request): Promise |
| 141 |
|
{ |
|
@@ 140-146 (lines=7) @@
|
| 137 |
|
return $this->handleResponse($response); |
| 138 |
|
} |
| 139 |
|
|
| 140 |
|
private function get(Request $request): Promise |
| 141 |
|
{ |
| 142 |
|
$header = $this->getHeader('GET', $request->getEndpoint(), ...$request->getParameters()); |
| 143 |
|
$response = $this->httpClient->get($request->getEndpoint(), $header, ...$request->getParameters()); |
| 144 |
|
|
| 145 |
|
return $this->handleResponse($response); |
| 146 |
|
} |
| 147 |
|
|
| 148 |
|
private function getHeader(string $method, Url $url, Parameter ...$parameters): Header |
| 149 |
|
{ |