src/SendsHttpRequestTrait.php
public function addMultipartParam(string $name, $content, string $filename = null, bool $overwrite = false)
    {
        if (array_key_exists($name, $this->multipart) && !$overwrite) {
            return $this;
        }
        $part = ['name' => $name, 'contents' => $content];
        if (!empty($filename)) {
            $part['filename'] = $filename;
        }
        $this->multipart[] = $part;
        return $this;
    }
public function addMultipartParam(string $name, $content, string $filename = null, bool $overwrite = false)
    {
        if (array_key_exists($name, $this->multipart) && !$overwrite) {
            return $this;
        }
        $part = ['name' => $name, 'contents' => $content];
        if (!empty($filename)) {
            $part['filename'] = $filename;
        }
        $this->multipart[] = $part;
        return $this;
    }
public function addMultipartParam ( string $ name , $ content , string $ filename = null , bool $ overwrite = false ) { if ( array_key_exists ( $ name , $ this -> multipart ) && ! $ overwrite ) { return $ this ; } $ part = [ 'name' => $ name , 'contents' => $ content ] ; if ( ! empty ( $ filename ) ) { $ part [ 'filename' ] = $ filename ; } $ this -> multipart [ ] = $ part ; return $ this ; }
Adds some multipart data to the request body.

@param string            $name
@param string|resource   $content the string content for the key; or resource gotten from fopen()
@param string|null       $filename
@param bool              $overwrite

@return $this
Adds some multipart data to the request body .