Improved Part support in MultipartBodyBuilder
1. Add contentType and filename options to PartBuilder. 2. Revert recently committed #44659f since asyncPart can't properly support Publisher of Part (only Mono, can't support filename), and replace that with support for Part in the regular part method. Closes gh-23083
This commit is contained in:
@@ -414,8 +414,9 @@ multipart request. The following example shows how to create a `MultiValueMap<St
|
||||
----
|
||||
MultipartBodyBuilder builder = new MultipartBodyBuilder();
|
||||
builder.part("fieldPart", "fieldValue");
|
||||
builder.part("filePart", new FileSystemResource("...logo.png"));
|
||||
builder.part("filePart1", new FileSystemResource("...logo.png"));
|
||||
builder.part("jsonPart", new Person("Jason"));
|
||||
builder.part("myPart", part); // Part from a server request
|
||||
|
||||
MultiValueMap<String, HttpEntity<?>> parts = builder.build();
|
||||
----
|
||||
|
||||
Reference in New Issue
Block a user