public interface ByteData extends UploadData
Modifier and Type | Method and Description |
---|---|
default byte[] |
bytes()
Returns an array containing the upload data bytes of the associated URL request.
|
default ContentType |
contentType()
Returns the content type of this upload data as specified in the
Content-Type header. |
static ByteData |
of(byte[] data)
Creates an instance of
ByteData with the given upload data bytes. |
static ByteData |
of(byte[] data,
ContentType contentType)
Creates an instance of
ByteData with the given upload data bytes and content type. |
static ByteData |
of(java.lang.String data)
Creates an instance of
ByteData with the given upload data bytes. |
static ByteData |
of(java.lang.String data,
ContentType contentType)
Creates an instance of
ByteData with the given upload data bytes and content type. |
static ByteData of(java.lang.String data)
ByteData
with the given upload data bytes.
The bytes are retrieved from the data
string using the
String.getBytes(Charset)
method with the UTF-8 charset.
static ByteData of(byte[] data)
ByteData
with the given upload data bytes.static ByteData of(java.lang.String data, ContentType contentType)
ByteData
with the given upload data bytes and content type.
The bytes are retrieved from the data
string using the
String.getBytes(Charset)
method with the UTF-8 charset.
static ByteData of(byte[] data, ContentType contentType)
ByteData
with the given upload data bytes and content type.default byte[] bytes()
UploadData
If the upload data is constructed manually and is not associated with a URL request, returns an empty array.
bytes
in interface UploadData
default ContentType contentType()
UploadData
Content-Type
header.
If the upload data is constructed manually, the Content-Type
header will be
created after it is passed to the Chromium engine. Thus, the returned ContentType
object will not contain meaningful values in this case.
contentType
in interface UploadData