You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I use the curlconverter to convert a complex curl command to JSON, specifically a command that uploads multiple files using the same form field name (key), the JSON output doesn't capture all the files. Instead, it overwrites the previous file with the last one having the same key.
it would also just ignore the "files": "picture1.jpg", line. But I agree that it would be better to warn about this situation or generate JSON with a duplicate key than silently dropping a key.
Rather than having duplicate keys in the JSON—since all JSON parsers override them—I believe it is better to use an array for that key instead of a string.
When I use the curlconverter to convert a complex curl command to JSON, specifically a command that uploads multiple files using the same form field name (key), the JSON output doesn't capture all the files. Instead, it overwrites the previous file with the last one having the same key.
Example
Output
Demonstrating the Problem with JavaScript:
When converting to other languages or libraries, such as JavaScript's Fetch API, multiple files for the same key are handled correctly:
As illustrated, the correct approach involves using multiple entries for each file under the files key.
The text was updated successfully, but these errors were encountered: