Skip to content

Commit

Permalink
CurlFile posibility added in Request
Browse files Browse the repository at this point in the history
  • Loading branch information
viniciuspugliese committed Jan 31, 2018
1 parent 83d7f69 commit 9b80ffd
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions src/Http/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use PrimeiraMao\Contracts\Http\Request as RequestContract;
use PrimeiraMao\Http\RequestBuilder;
use PrimeiraMao\PrimeiraMao;
use CurlFile;

/**
* PrimeiraMao API
Expand Down Expand Up @@ -73,6 +74,11 @@ class Request extends RequestBuilder implements RequestContract
*/
private $data = [];

/**
* @var array
*/
private $filedata = [];

/**
* @var string
*/
Expand Down Expand Up @@ -168,4 +174,29 @@ public function getData()
{
return $this->data;
}

/**
* Set request file
*
* @param array $filedata
* @return $this
*/
public function setFileData(array $filedata)
{
$this->filedata = [
'Filedata' => new CurlFile($filedata['tmp_name'], $filedata['type'], $filedata['name']),
];

return $this;
}

/**
* Get request file
*
* @return array
*/
public function getFileData() : array
{
return $this->filedata;
}
}

0 comments on commit 9b80ffd

Please sign in to comment.