public class Part extends Object
| Constructor and Description |
|---|
Part(String name,
Optional<String> fileName,
Optional<String> contentType,
AsyncContentProvider content,
Map<String,String> fields)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
static Part |
createFieldPart(String name,
AsyncContentProvider value)
Creates a simple text/plain field that can be part of the multipart request.
|
static Part |
createFieldPart(String name,
String value)
Creates a simple text/plain field that can be part of the multipart request.
|
AsyncContentProvider |
getContent() |
String |
getHeaders() |
String |
toString() |
public Part(String name, Optional<String> fileName, Optional<String> contentType, AsyncContentProvider content, Map<String,String> fields)
name - Name of the field.fileName - Optional name of the file that is sent up. In case a simple field is sent, this may be
Optional.empty(). This is the same as specifying the filename key-value
pair in the fields parameter.contentType - Optional content type of the field/file. The final content type of the field is
derived with the following algorythm:
AsyncContentProvider.getContentType() function of the content
parameter returns a value, that is used. Otherwisecontent - The content of this multipart value.fields - Additional fields of this multipart value. It is recommended to use only ISO8859-1
characters in field names and values.public static Part createFieldPart(String name, AsyncContentProvider value)
name - The name of the field.value - The value of the field.public static Part createFieldPart(String name, String value)
name - The name of the field.value - The value of the field.public AsyncContentProvider getContent()
public String getHeaders()
Copyright © 2011–2019 Everit Kft.. All rights reserved.