Skip to content

Encode

Encode or decode a string using common encoding formats.

FieldTypeRequiredDescription
inputstringYesString to encode or decode
formatstringYesbase64, url, html, hex, punycode
actionstringYesencode or decode
FieldTypeDescription
outputstringEncoded or decoded result
formatstringFormat used
actionstringAction performed
Terminal window
curl -X POST https://morso.dev/api/encode \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"input": "hello world", "format": "base64", "action": "encode"}'
{
"output": "aGVsbG8gd29ybGQ=",
"format": "base64",
"action": "encode"
}
Terminal window
curl -X POST https://morso.dev/api/encode \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"input": "hello%20world%21", "format": "url", "action": "decode"}'
{
"output": "hello world!",
"format": "url",
"action": "decode"
}
Terminal window
curl -X POST https://morso.dev/api/encode \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"input": "hello", "format": "hex", "action": "encode"}'
{
"output": "68656c6c6f",
"format": "hex",
"action": "encode"
}