Level 34
@subh try to json_encode it
json_encode($request->input('tags'))
2 likes
I am trying to upload form data with a file using Guzzle. One of the form data is an array.
$response = $client->request('POST', 'someurl.com/api', [
'multipart'=> [['name'=> 'name', 'contents' => $request->input('name')],
['name'=> 'tags', 'contents' => $request->input('tags')], // this is an array
['name'=> 'tagsType', 'contents' => static::$GENERAL],
['name'=> 'file', 'contents' => fopen($request->file('file'), 'r')]], // file
]);
@subh try to json_encode it
json_encode($request->input('tags'))
Please or to participate in this conversation.