Skip to content

Conversation

@Zcodeoooo
Copy link

Version
1.57

Steps to reproduce
An extension to the issue
#2784

Adds support for string arrays in multipart fields, allowing usage like:

multipart = {
    "codes[]": ["C34376202", "C481866"],
    "files"= [ 
        { "name"="Document1.txt", "mimeType":"text/plain", buffer: b"Text file 1 content" },
        { "name"="Document2.txt", "mimeType":"text/plain", buffer: b"Text file 2 content" }
    ]
}


Previously, only single values (str/file) were supported due to type and logic limitations.
Changes madeUpdated multipart type hint to include List[Union[str, FilePayload]]
✅ Enhanced handling of list values in form field processingImproved is_file_array_payload to correctly identify file arraysAdded support for multiple same-named fields (e.g. codes[]) via list expansion
Why this is useful
Enables sending arrays of strings (e.g. batch codes, IDs) in multipart requestsa common use case when interacting with web forms or APIs expecting repeated keys.
This aligns with real-world HTTP behavior where field[] syntax is widely used for array submission.

@Zcodeoooo
Copy link
Author

@microsoft-github-policy-service agree

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant