diff --git a/examples/00.send-message-amp.php b/examples/00.send-message-amp.php index 1b339c6..e550490 100644 --- a/examples/00.send-message-amp.php +++ b/examples/00.send-message-amp.php @@ -17,5 +17,7 @@ $sendMessage->chat_id = A_USER_CHAT_ID; $sendMessage->text = 'Hello world!'; - $tgLog->performApiRequest($sendMessage); + $result = yield $tgLog->performApiRequest($sendMessage); + + var_dump($result); }); \ No newline at end of file diff --git a/src/HttpClientRequestHandlerAmp.php b/src/HttpClientRequestHandlerAmp.php index 5cee4a9..bb67857 100644 --- a/src/HttpClientRequestHandlerAmp.php +++ b/src/HttpClientRequestHandlerAmp.php @@ -65,9 +65,8 @@ public function get(string $uri): PromiseInterface * @return PromiseInterface * @throws \unreal4u\TelegramAPI\Exceptions\ClientException */ - public function post(string $uri, array $formFields): PromiseInterface - { - $request = (new Request($uri))->withMethod('POST'); + public function post(string $uri, array $formFields): PromiseInterface { + $request = new Request($uri, 'POST'); if (!empty($formFields['headers'])) { $request = $request->withHeaders($formFields['headers']);