Question : yii2 htpp client form data
Answered by : bahriddin
use yii\httpclient\Client;
$client = new Client();
$response = $client->createRequest() ->setMethod('POST') ->setUrl('http://domain.com/file/upload') ->addFile('file', '/path/to/source/file.jpg') ->send();
Source : | Last Update : Tue, 05 Apr 22