Package ratpack.test.http
Interface MultipartFileSpec
-
public interface MultipartFileSpec
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description MultipartFormSpec
add()
Add the file to the parent multipart formMultipartFileSpec
contentType(String contentType)
Specify the content typeMultipartFileSpec
data(byte[] data)
Specify the file contentsMultipartFileSpec
data(String data)
Specify the file contentsMultipartFileSpec
encoding(String encoding)
Specify the form fieldMultipartFileSpec
field(String field)
Specify the form fieldMultipartFileSpec
name(String name)
Specify the uploaded filename
-
-
-
Method Detail
-
add
MultipartFormSpec add()
Add the file to the parent multipart formNote: Must be called to include the file into the payload.
- Returns:
- a specification of a multipart form
-
contentType
MultipartFileSpec contentType(String contentType)
Specify the content typeRequired. Defaults to 'text/plain'.
- Returns:
- a specification of a multipart file
-
data
MultipartFileSpec data(byte[] data)
Specify the file contentsRequired. No default provided.
- Returns:
- a specification of a multipart file
-
data
MultipartFileSpec data(String data)
Specify the file contentsRequired. No default provided.
Note: this value is encoded into a byte array using UTF-8
- Returns:
- a specification of a multipart file
-
encoding
MultipartFileSpec encoding(String encoding)
Specify the form fieldOptional. No default provided.
Valid options include BASE64, QUOTED-PRINTABLE, 8BIT, 7BIT, BINARY. Custom encodings of the for X-
are also supported. See https://www.w3.org/Protocols/rfc1341/5_Content-Transfer-Encoding.html for more information. Note: Netty will need to understand this encoding scheme.
- Returns:
- a specification of a multipart file
-
field
MultipartFileSpec field(String field)
Specify the form fieldRequired. Defaults to 'file'.
- Returns:
- a specification of a multipart file
-
name
MultipartFileSpec name(String name)
Specify the uploaded filenameRequired. Defaults to 'filename.txt'.
- Returns:
- a specification of a multipart file
-
-