From b64e6d851082d6ffe971e2d8c7ac2838ef840760 Mon Sep 17 00:00:00 2001 From: Bruno Francisco Date: Fri, 28 Jul 2023 12:15:29 +0200 Subject: [PATCH] Add asynchronous request to curl - added `CURLOPT_HEADER` and `CURLOPT_RETURNTRANSFER` to false - CURLOPT_HEADER set to false tells that we do not care about the headers sent back by the server - CURLOPT_RETURNTRANSFER set to false tells that we do not care about the response body from the server --- src/Events/DatabaseTransactionEvent.php | 2 ++ src/Events/LogEvent.php | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/Events/DatabaseTransactionEvent.php b/src/Events/DatabaseTransactionEvent.php index 88f75ec..a422a3e 100644 --- a/src/Events/DatabaseTransactionEvent.php +++ b/src/Events/DatabaseTransactionEvent.php @@ -24,6 +24,8 @@ public function create(string $sessionId, string $sessionSecret, array $data): v $this->setOption(CURLOPT_URL, $endpoint); $this->setOption(CURLOPT_RETURNTRANSFER, true); + $this->setOption(CURLOPT_HEADER, false); + $this->setOption(CURLOPT_RETURNTRANSFER, false); $this->setOption( CURLOPT_POSTFIELDS, $this->generatePayload($data, self::EVENT_TYPE) diff --git a/src/Events/LogEvent.php b/src/Events/LogEvent.php index bd66bc4..2e773e1 100644 --- a/src/Events/LogEvent.php +++ b/src/Events/LogEvent.php @@ -50,6 +50,8 @@ public function create(string $sessionId, string $sessionSecret, array $data): v $this->setOption(CURLOPT_URL, $endpoint); $this->setOption(CURLOPT_RETURNTRANSFER, true); + $this->setOption(CURLOPT_HEADER, false); + $this->setOption(CURLOPT_RETURNTRANSFER, false); $this->setOption( CURLOPT_POSTFIELDS, $this->generatePayload($data, self::EVENT_TYPE)