encode and decode, text or file
// output appears here
curl -sX POST 'https://api.whittly.dev/v1/base64/encode' \
-H 'Authorization: Bearer $WHITTLY_API_KEY' \
-H 'Content-Type: application/json' \
-d '{"input":"hello world"}'
const res = await fetch('https://api.whittly.dev/v1/base64/encode', {
method: 'POST',
headers: {
'Authorization': 'Bearer ' + apiKey,
'Content-Type': 'application/json',
},
body: JSON.stringify({ input: "hello world" }),
});
const data = await res.json();
const { data } = await axios.post(
'https://api.whittly.dev/v1/base64/encode',
{ input: "hello world" },
{ headers: { Authorization: 'Bearer ' + apiKey } }
);
Base64 encoding converts binary or text data into a string of 64 printable ASCII characters, making it safe to include in URLs, HTML attributes, and JSON payloads. The decoder reverses the process, restoring the original bytes.