Add mime type support for text MultiValuePart with configurable multipart mode#4167
Open
filiphr wants to merge 1 commit intoflowable:mainfrom
Open
Add mime type support for text MultiValuePart with configurable multipart mode#4167filiphr wants to merge 1 commit intoflowable:mainfrom
filiphr wants to merge 1 commit intoflowable:mainfrom
Conversation
…part mode Add a fromText(name, value, mimeType) factory method to MultiValuePart so that text parts can specify a custom Content-Type (e.g. application/json). Both Apache HTTP client implementations now respect the mime type on text parts by passing ContentType to addTextBody when set. The multipart entity builder mode is changed from BROWSER_COMPATIBLE/LEGACY to STRICT so that Content-Type headers are written for all parts including text parts. For backward compatibility, the multipart mode is configurable via HttpClientConfig.setMultipartMode(). Supported values are STRICT (default), BROWSER_COMPATIBLE, LEGACY, and EXTENDED. The Spring WebClient implementation is unaffected as it already handled mime types for all parts.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add a fromText(name, value, mimeType) factory method to MultiValuePart so that text parts can specify a custom Content-Type (e.g. application/json).
Both Apache HTTP client implementations now respect the mime type on text parts by passing ContentType to addTextBody when set. The multipart entity builder mode is changed from BROWSER_COMPATIBLE/LEGACY to STRICT so that Content-Type headers are written for all parts including text parts.
For backward compatibility, the multipart mode is configurable via HttpClientConfig.setMultipartMode(). Supported values are STRICT (default), BROWSER_COMPATIBLE, LEGACY, and EXTENDED. The Spring WebClient implementation is unaffected as it already handled mime types for all parts.