I am trying to upload a file and send message parameters at the same time as follows:
$response = $client->post('http://example.com/api', [ 'form_params' => [ 'name' => 'Example name', ], 'multipart' => [ [ 'name' => 'image', 'contents' => fopen('/path/to/image', 'r') ] ] ]);
However, my form_params fields are ignored, and only multipart fields are present in my mail body. Can I send both using gzzle 6.0?
source share