diff --git a/src/Request/FluentRequest.php b/src/Request/FluentRequest.php index f6e527e..a2257bc 100644 --- a/src/Request/FluentRequest.php +++ b/src/Request/FluentRequest.php @@ -125,7 +125,7 @@ public function execute() { default: throw new \Exception("No appropriate HTTP method found for this request."); } - + return $this->handleResponse($response); } @@ -134,16 +134,16 @@ public function execute() { */ protected function executeFileUpload(string $route, string $filepath) { $endpointUrl = $this->endpointUri."/".$route; - + $this->options[CURLOPT_HTTPHEADER][] = "Api-Key:".$this->credentials->getApiKey(); $webHelper = new WebHelper($this->container); $response = $webHelper->putImageRequest($endpointUrl, $this->requestDetails, - $this->options, - $filepath); - + $filepath, + $this->options); + return $this->handleResponse($response); } @@ -193,4 +193,4 @@ public function withCustomParameter(string $name, string $value) { */ abstract protected function getRoute(); } -} \ No newline at end of file +} diff --git a/src/Request/WebHelper.php b/src/Request/WebHelper.php index df3bab5..c2b5046 100644 --- a/src/Request/WebHelper.php +++ b/src/Request/WebHelper.php @@ -97,11 +97,11 @@ public function put($endpoint, $queryParams, array $options = array(), array $da * Send a PUT requst using cURL * @param string $url to request * @param array $queryParams values to send - * @param array $options for cURL * @param string $filepath of image to add + * @param array $options for cURL * @return string */ - public function putImageRequest($endpoint, $queryParams, array $options = array(), string $filepath) { + public function putImageRequest($endpoint, $queryParams, string $filepath, array $options = array()) { $image = fopen($filepath, "rb");