Skip to main content

http.base64encode(dataToEncode)

Encodes a string or blob in Base64 format

Availability

Agent

Parameters

Name Type Description
dataToEncode String or blob The data you wish to encode

Returns

String — the Base64-encoded data

Description

This method encodes binary data or a string of characters into a Base64 string, as defined in the RFC4648 specification. This is often useful when you are working with web services, such as those which exchange data in JSON format, as these are not usually equipped to handle raw binary data.

The corresponding decoding operation is http.base64decode().