Functions -
mime
base64Decode |
Deprecated API. Decodes a given input with MIME specific Base64 encoding scheme.
|
base64DecodeBlob |
Deprecated API. Decodes a given byte[] using the Base64 encoding scheme.
|
base64Encode |
Deprecated API. Encodes a given input with MIME specific Base64 encoding scheme.
|
base64EncodeBlob |
Deprecated API. Encodes a given byte[] using the Base64 encoding scheme.
|
getContentDispositionObject |
Given the Content-Disposition as a string, gets the ContentDisposition object with it.
|
getMediaType |
Gets the
MediaType object populated with it when the Content-Type is in string.
|
prepareDecodingErrorWithDetail |
Constructs a
DecodeError with the given details.
|
prepareEncodingErrorWithDetail |
Constructs an
EncodeError with the given details.
|
base64Decode
(string | byte[] | ReadableByteChannel contentToBeDecoded, string charset)
returns string | byte[] | ReadableByteChannel | DecodeErrorParameters
- contentToBeDecoded string | byte[] | ReadableByteChannel
-
Content that needs to be decoded can be of type
string
,byte[]
orio:ReadableByteChannel
- charset string (default utf-8)
-
Charset to be used. This is used only with the string input
-
Return Type
(string | byte[] | ReadableByteChannel | DecodeError) A decoded
string
if the given input is of type string, a decodedbyte[]
if the given input is of type byte[], a decodedio:ReadableByteChannel
if the given input is of type io:ReadableByteChannel or else amime:DecodeError
in case of errors
Parameters
- valueToBeDecoded byte[]
-
Content, which needs to be decoded
-
Return Type
(byte[] | DecodeError) A decoded
byte[]
or else amime:DecodeError
record in case of errors
base64Encode
(string | byte[] | ReadableByteChannel contentToBeEncoded, string charset)
returns string | byte[] | ReadableByteChannel | EncodeErrorParameters
- contentToBeEncoded string | byte[] | ReadableByteChannel
-
Content that needs to be encoded can be of type
string
,byte[]
orio:ReadableByteChannel
- charset string (default utf-8)
-
Charset to be used. This is used only with the string input
-
Return Type
(string | byte[] | ReadableByteChannel | EncodeError) An encoded
string
if the given input is of type string, an encodedbyte[]
if the given input is of type byte[], an encodedio:ReadableByteChannel
if the given input is of typeio:ReadableByteChannel
, or else amime:EncodeError
record in case of errors
Parameters
- valueToBeEncoded byte[]
-
Content, which needs to be encoded
-
Return Type
(byte[] | EncodeError) An encoded byte[] or else a
mime:EncodeError
record in case of errors
Parameters
- contentDisposition string
-
Content disposition string
-
Return Type
(ContentDisposition) A
ContentDisposition
object
MediaType
object populated with it when the Content-Type
is in string.
Parameters
- contentType string
-
Content-Type in string
-
Return Type
(MediaType | InvalidContentTypeError) MediaType
object or else amime:InvalidContentTypeError
in case of an invalid content-type
DecodeError
with the given details.
Parameters
- detail string
-
Error details
-
Return Type
(DecodeError) DecodeError
with the given details set to the message
EncodeError
with the given details.
Parameters
- detail string
-
Error details
-
Return Type
(EncodeError) An
EncodeError
with the given details set to the message