Hi,
I'm trying to POST multipart/form-data files.
I'm using:
$client = new GuzzleHttp\Client();
$request = $client->createRequest('POST', '
https://localhost/1/files/', ['json' => ['id' => 'dc51bfe4-92af-483d-80c4-f2da4cafa723'], 'cookies' => true]);
$request->getBody()->addFile(new PostFile('a.pdf', fopen('a.pdf', 'rb')));
$response = $this->client->send($request);
I'm getting this error:
Fatal error: Call to undefined method GuzzleHttp\Stream\Stream::addFile()
The same happens if I replace addFile with addPostFile.
Why is this happening? Which call should I be using?