кодирование и декодирование, текст или файл
// результат появится здесь
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-кодирование преобразует бинарные или текстовые данные в строку из 64 печатаемых ASCII-символов, что позволяет безопасно передавать их в URL, HTML-атрибутах и JSON. Декодер выполняет обратное преобразование.