I need to upload files in Guzzle 6 but is mandatory to use "form_params" options. To make a POST request just with data I'm using
$client->post('http://xxx/', [
'form_params' => [
[
'data' => ['id' => 1234, 'name' => 'nombre'],
'valid' => true
]
]
]);
Since I can't use "multipart" together with "form_params", is there any way to add files inside "form_params" option in Guzzle 6? Something like this:
$client->post('http://xxx/', [
'form_params' => [
[
'data' => ['id' => 1234, 'name' => 'nombre'],
'valid' => true,
'file1' => fopen('/path/to/file', 'r'),
'file2_content' => 'data content'
]
]
]);
Thanks!!