DevTools.at
API Documentation
POST/api/v1/json-escape

JSON Escape

Escape or unescape JSON strings

encoders

Parameters

inputstring
Yes

String to escape/unescape

actionstring
No

'escape' or 'unescape'

Default: escape

Example Request

curl -X POST https://devtools.at/api/v1/json-escape \
  -H "Content-Type: application/json" \
  -d '{"input":"Line 1\nLine 2\t\"quoted\"","action":"escape"}'

Example Response

{
  "success": true,
  "data": {
    "result": "Line 1\\nLine 2\\t\\\"quoted\\\""
  },
  "meta": {
    "processingTime": 1
  }
}

Try it out

Test this endpoint directly in your browser

Response
Click "Execute Request" to see the response