Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Accepts nested array in multipart option field value #616

Open
wants to merge 3 commits into
base: 2.7
Choose a base branch
from

Conversation

RomainMazB
Copy link

This PR expands a MultipartStream element with a nested array contents into multiple separated and well-formed elements.

Basically, this:

[
  'name' => 'foo',
  'contents' => [
    ['key' => 'bar'],
    ['key' => 'baz']
  ]
]

results into this:

--boundary
Content-Disposition: form-data; name=foo[0][key]
Content-Length: 3

bar
--boundary
Content-Disposition: form-data; name=foo[1][key]
Content-Length: 3

baz
--boundary--

This is an attempt to ease the DX for Guzzle, see guzzle/guzzle#3260

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant