接口 MultipartBodyBuilder.PartBuilder
public static interface MultipartBodyBuilder.PartBuilder
Builder that allows for further customization of part headers.
方法概要
所有方法 实例方法 抽象方法 修饰符和类型 方法 说明 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.
方法详细资料
contentType
MultipartBodyBuilder.PartBuilder contentType(MediaType contentType)
Set the media type of the part.- 参数:
contentType- the content type- 从以下版本开始:
- 5.2
- 另请参阅:
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.- 参数:
filename- the filename to set on the Content-Disposition- 从以下版本开始:
- 5.2
header
MultipartBodyBuilder.PartBuilder header(String headerName, String... headerValues)
Add part header values.- 参数:
headerName- the part header nameheaderValues- the part header value(s)- 返回:
- this builder
- 另请参阅:
HttpHeaders.addAll(String, List)
headers
MultipartBodyBuilder.PartBuilder headers(Consumer<HttpHeaders> headersConsumer)
Manipulate the part headers through the given consumer.- 参数:
headersConsumer- consumer to manipulate the part headers with- 返回:
- this builder