Encode
Encode or decode a string using common encoding formats.
POST /api/encode
Section titled “POST /api/encode”Parameters
Section titled “Parameters”| Field | Type | Required | Description |
|---|---|---|---|
input | string | Yes | String to encode or decode |
format | string | Yes | base64, url, html, hex, punycode |
action | string | Yes | encode or decode |
Response
Section titled “Response”| Field | Type | Description |
|---|---|---|
output | string | Encoded or decoded result |
format | string | Format used |
action | string | Action performed |
Examples
Section titled “Examples”Base64 encode
Section titled “Base64 encode”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"}URL decode
Section titled “URL decode”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"}Hex encode
Section titled “Hex encode”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"}