From 746ce97039d2c80516ccb45b23bbcb2a804b1033 Mon Sep 17 00:00:00 2001 From: Orka Arnest CRUZE Date: Tue, 21 Nov 2023 15:46:59 +0100 Subject: [PATCH] refactor(AbstractEntrepotApiService): postFile devient SendFile (POST ou PUT) --- src/Services/EntrepotApi/AbstractEntrepotApiService.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Services/EntrepotApi/AbstractEntrepotApiService.php b/src/Services/EntrepotApi/AbstractEntrepotApiService.php index 44bd1715..1d8c080a 100644 --- a/src/Services/EntrepotApi/AbstractEntrepotApiService.php +++ b/src/Services/EntrepotApi/AbstractEntrepotApiService.php @@ -51,7 +51,7 @@ public function setEntrepotApiService(EntrepotApiService $entrepotApiService): s * @param array $formFields correspond à "Request Body" dans le swagger * @param array $query correspond aux paramètes "Query" dans le swagger */ - protected function postFile(string $url, string $filepath, array $formFields = [], array $query = []): array + protected function sendFile(string $method, string $url, string $filepath, array $formFields = [], array $query = []): array { $formFields['file'] = DataPart::fromPath($filepath); // ajout du fichier dans $formFields $formData = new FormDataPart($formFields); @@ -59,7 +59,7 @@ protected function postFile(string $url, string $filepath, array $formFields = [ $body = $formData->bodyToIterable(); $headers = $formData->getPreparedHeaders()->toArray(); - return $this->request('POST', $url, $body, $query, $headers, true); + return $this->request($method, $url, $body, $query, $headers, true); } /**