Package org.springframework.http.client
Interface MultipartBodyBuilder.PartBuilder
- Enclosing class:
- MultipartBodyBuilder
public static interface MultipartBodyBuilder.PartBuilder
Builder that allows for further customization of part headers.
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description MultipartBodyBuilder.PartBuildercontentType(MediaType contentType)Set the media type of the part.MultipartBodyBuilder.PartBuilderfilename(String filename)Set the filename parameter for a file part.MultipartBodyBuilder.PartBuilderheader(String headerName, String... headerValues)Add part header values.MultipartBodyBuilder.PartBuilderheaders(Consumer<HttpHeaders> headersConsumer)Manipulate the part headers through the given consumer.
Method Detail
contentType
MultipartBodyBuilder.PartBuilder contentType(MediaType contentType)
Set the media type of the part.- Parameters:
contentType- the content type- Since:
- 5.2
- See Also:
HttpHeaders.setContentType(MediaType)
filename
MultipartBodyBuilder.PartBuilder filename(String filename)
Set the filename parameter for a file part. This should not be necessary withResourcebased parts that expose a filename but may be useful forPublisherparts.- Parameters:
filename- the filename to set on the Content-Disposition- Since:
- 5.2
header
MultipartBodyBuilder.PartBuilder header(String headerName, String... headerValues)
Add part header values.- Parameters:
headerName- the part header nameheaderValues- the part header value(s)- Returns:
- this builder
- See Also:
HttpHeaders.addAll(String, List)
headers
MultipartBodyBuilder.PartBuilder headers(Consumer<HttpHeaders> headersConsumer)
Manipulate the part headers through the given consumer.- Parameters:
headersConsumer- consumer to manipulate the part headers with- Returns:
- this builder