From 8cc018efee29e520de0d7ceda7324e9536d7f5ee Mon Sep 17 00:00:00 2001 From: Vinicius Pugliesi Date: Wed, 31 Jan 2018 16:08:25 +0000 Subject: [PATCH] CurlFile posibility added in RequestBuilder --- src/Http/RequestBuilder.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Http/RequestBuilder.php b/src/Http/RequestBuilder.php index d2dcd9b..f808d41 100644 --- a/src/Http/RequestBuilder.php +++ b/src/Http/RequestBuilder.php @@ -39,6 +39,11 @@ public function send() curl_setopt($curl, CURLOPT_POSTFIELDS, $this->getData()); } + if ($this->getFileData()) { + curl_setopt($curl, CURLOPT_POST, true); + curl_setopt($curl, CURLOPT_POSTFIELDS, $this->getFileData()); + } + $data = curl_exec($curl); $info = curl_getinfo($curl);