Base64 encode
Try it interactively →POST /api/base64-encodeEncode arbitrary bytes as base64 (standard or URL-safe). Optional padding stripping for URL-friendly output.
Inputs
| Name | Type | Default | Description |
|---|---|---|---|
| data* | file | — | Bytes to encode (any binary input). |
| alphabet | enum (base64 | base64url) | "base64" | `base64` (standard) or `base64url` (URL-safe). |
| omitPadding | boolean | false | Strip trailing `=` padding. |
Response
Modes: json, text. Cache: yes (24h TTL).
Code samples
Built from the hello example.
# Download or substitute the example input:
# curl -O https://xtract.bot/examples/base64-encode/hello.txt
DATA=$(base64 -w0 < hello.txt)
curl -X POST https://api.xtract.bot/api/base64-encode \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "X-Account-Id: $XTRACT_ACCOUNT_ID" \
-H "X-Api-Key: $XTRACT_API_KEY" \
-d '{
"alphabet": "base64",
"data": "'"$DATA"'"
}'