endpoint = $endpoint; $this->httpClient = $httpClient ?: new http_client(); } public function send_data($data) { $response = $this->httpClient->post($this->endpoint, $data); return $response; } }