Functions -
encoding
decodeBase64Url |
Decodes the Base64 URL encoded |
decodeUriComponent |
Decodes the given URI component into a |
encodeBase64Url |
Returns the Base64 URL encoded |
encodeUriComponent |
Encodes the given URI component into a |
Decodes the Base64 URL encoded string
into a byte array.
byte[]|encoding:Error urlDecodedValue = encoding:decodeBase64Url("SGVsbMO2IFfDtnJsZEBCYWxsZXJpbmE");
Parameters
- input string
-
Value to be decoded
-
Return Type
(byte[] | Error) Decoded output or else a
mime:Error
if the input is not a valid Base64 URL encoded value
Decodes the given URI component into a string
using the provided charset.
string encodedUrl = "http://www.domain.com/?param1=http%3A%2F%2Fxyz.com%2F%3Fa%3D12%26b%3D55¶m2=99";
string|encoding:Error decodedUriComponent = encoding:decodeUriComponent(encodedUrl, "UTF-8");
Parameters
- uriComponent string
-
URI component to be decoded
- charset string
-
Character set to be used in decoding the URI
-
Return Type
(string | Error) The
string
value of the decoded URI component or anError
that occurred during decoding
Returns the Base64 URL encoded string
value of the given byte array.
string query = "Hellö Wörld@Ballerina";
string urlEncodedValue = encoding:encodeBase64Url(query.toBytes());
Parameters
- input byte[]
-
Byte array to be encoded
-
Return Type
(string) Encoded output
Encodes the given URI component into a string
using the provided charset.
string urlValue = "param1=http://xyz.com/?a=12&b=55¶m2=99";
string|encoding:Error encodedUriComponent = encoding:encodeUriComponent(urlValue, "UTF-8");
Parameters
- uriComponent string
-
URI component to be encoded
- charset string
-
Character set to be used in encoding the URI
-
Return Type
(string | Error) The
string
value of the encoded URI component or anError
that occurred during encoding