- let mut response = match self.client.post::<JsonResponse>(&uri, &host, &self.basic_auth, content).await {
+ let mut client = if let Some(client) = self.client.lock().unwrap().take() { client }
+ else { HttpClient::connect(&self.endpoint)? };
+ let http_response = client.post::<JsonResponse>(&uri, &host, &self.basic_auth, content).await;
+ *self.client.lock().unwrap() = Some(client);
+
+ let mut response = match http_response {