src/PutIO/Engines/HTTP/NativeEngine.php
public function request(
        $method,
        $url,
        array $params = [],
        $outFile = '',
        $returnBool = \false,
        $arrayKey = '',
        $verifyPeer = \true
    ) {

        list($url, $contextOptions) = $this->configureRequestOptions($url, $method, $params, $verifyPeer);
        $fp = @fopen($url, 'rb', \false, stream_context_create($contextOptions));
        $headers = stream_get_meta_data($fp)['wrapper_data'];

        return $this->handleRequest($fp, $headers, $outFile, $returnBool, $arrayKey);
    }
public function request(
        $method,
        $url,
        array $params = [],
        $outFile = '',
        $returnBool = \false,
        $arrayKey = '',
        $verifyPeer = \true
    ) {

        list($url, $contextOptions) = $this->configureRequestOptions($url, $method, $params, $verifyPeer);
        $fp = @fopen($url, 'rb', \false, stream_context_create($contextOptions));
        $headers = stream_get_meta_data($fp)['wrapper_data'];

        return $this->handleRequest($fp, $headers, $outFile, $returnBool, $arrayKey);
    }
public function request ( $ method , $ url , array $ params = [ ] , $ outFile = '' , $ returnBool = \ false , $ arrayKey = '' , $ verifyPeer = \ true ) { list ( $ url , $ contextOptions ) = $ this -> configureRequestOptions ( $ url , $ method , $ params , $ verifyPeer ) ; $ fp = @ fopen ( $ url , 'rb' , \ false , stream_context_create ( $ contextOptions ) ) ; $ headers = stream_get_meta_data ( $ fp ) [ 'wrapper_data' ] ; return $ this -> handleRequest ( $ fp , $ headers , $ outFile , $ returnBool , $ arrayKey ) ; }
Makes an HTTP request to put.io's API and returns the response.
Relies on native PHP functions.

NOTE!! Due to restrictions, files must be loaded into the memory when
uploading. I don't recommend uploading large files using native
functions. Only use this if you absolutely must! Otherwise, the cURL
engine is much better!

Downloading is no issue as long as you're saving the file somewhere on
the file system rather than the memory. Set $outFile and you're all set!

Returns false if a file was not found.

@param string $method      HTTP request method. Only POST and GET are
supported.
@param string $url         Remote path to API module.
@param array  $params      Variables to be sent.
@param string $outFile     If $outFile is set, the response will be
written to this file instead of StdOut.
@param bool   $returnBool
@param string $arrayKey    Will return all data on a specific array key
of the response.
@param bool   $verifyPeer  If true, will use proper SSL peer/host
verification.
@return mixed
@throws \PutIO\Exceptions\LocalStorageException
@throws \PutIO\Exceptions\RemoteConnectionException
Makes an HTTP request to put . io s API and returns the response . Relies on native PHP functions .