Skip to content

Render multipart filename, content-type, and per-part headers in toCurl#2893

Merged
adamw merged 1 commit into
masterfrom
tocurl-multipart-metadata
May 28, 2026
Merged

Render multipart filename, content-type, and per-part headers in toCurl#2893
adamw merged 1 commit into
masterfrom
tocurl-multipart-metadata

Conversation

@adamw
Copy link
Copy Markdown
Member

@adamw adamw commented May 28, 2026

Fixes #2881. The toCurl converter was dropping multipart metadata (filename, content-type, and custom headers) when generating curl command output. This made the generated curl commands incomplete and unable to faithfully reproduce the original HTTP request.

This change adds support for emitting multipart metadata using curl's form-field extensions:

  • Filenames via the ;filename= parameter
  • Content-Type via the ;type= parameter
  • Custom headers via the ;headers= parameter (Content-Type is filtered to avoid duplication)

Values containing single quotes are escaped with backslashes to ensure proper shell syntax. Tests cover all metadata combinations including edge cases with special characters.

Closes #2881.

@adamw adamw merged commit cb82036 into master May 28, 2026
27 checks passed
@adamw adamw deleted the tocurl-multipart-metadata branch May 28, 2026 17:11
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.

toCurl drops multipart filename, content-type, and per-part headers

1 participant