Skip to content

Escape

Standard · 1 credit

Escape or unescape a string for safe use in HTML, XML, CSV, SQL, shell commands, or regular expressions.

FieldTypeRequiredDescription
inputstringYesString to escape or unescape
contextstringYeshtml, xml, csv, sql, shell, regex
actionstringYesescape or unescape
FieldTypeDescription
outputstringEscaped or unescaped result
contextstringContext used
actionstringAction performed
Terminal window
curl -X POST https://morso.dev/api/escape \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"input": "<script>alert(\"xss\")</script>", "context": "html", "action": "escape"}'
{
"output": "&lt;script&gt;alert(&quot;xss&quot;)&lt;/script&gt;",
"context": "html",
"action": "escape"
}
Terminal window
curl -X POST https://morso.dev/api/escape \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"input": "hello; rm -rf /", "context": "shell", "action": "escape"}'
{
"output": "'hello; rm -rf /'",
"context": "shell",
"action": "escape"
}
Terminal window
curl -X POST https://morso.dev/api/escape \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"input": "it''s a test", "context": "sql", "action": "unescape"}'
{
"output": "it's a test",
"context": "sql",
"action": "unescape"
}