callHttp(HttpMethods::post(), route('mailjet.unsubscribe'))); } /** * Make HTTP Calls * * @param HttpMethods $method * @param string $uri * @param array $headers * @param array $data * @return ResponseInterface */ private function callHttp( HttpMethods $method, string $uri, array $headers = [], array $data = [] ): ResponseInterface { $request = new Psr7Request( \strtoupper($method), $uri, $headers, $method->equals(HttpMethods::get()) ? null : \json_encode($data) ); if (!$this->client) { $this->client = new Client(); } return $this->client->send($request, [ 'http_errors' => false // do not throw http errors ]); } }