Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[Mime][FormDataPart] Add support of multidimensional fields in constructor#33064
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
jvahldick commentedOct 10, 2019
Hi, First of all, thanks@wtorsi for your time taking a look on this issue. I have a similar issue when trying toPOST arrays using the HttpClient component together with Mime. Let's say I am trying to send an array of tags for creating a media file. $formFields = ['media' => ['tags' => [ ['name' =>'first-tag' ], ['name' =>'first-tag' ] ], ],]; Using the PR code, as result, I have the following field names: However, when sending a form-data, what I expect on the backend is something like: I changed a bit the closure function to have the result I was expecting, which I am not sure it is the correct way. $prepare =function ($item,$key,$root =null)use (&$values, &$prepare) {$fieldName =$root ?$root .'['.$key.']' :$key;if (\is_array($item)) {array_walk($item,$prepare,$fieldName);return; }$values[] =$this->preparePart($fieldName,$item);}; Any thoughts? |
fabpot commentedAug 13, 2020
Closing as it seems to have been fixed by#34032 |
Add support of multidimensional fields in FormDataPart.