Skip to content

\n in request body is treated as a literal newline instead of an escape sequence #274

Description

@randy31988

When typing \n in the request body editor, Yaade stores it as a literal newline character (ASCII 10) instead of the two-character escape sequence \ + n. This results in invalid JSON being sent, because the JSON specification does not allow unescaped newline characters inside strings.

To Reproduce

  1. Create a new request in Yaade
  2. Set the method to POST and the Content-Type header to application/json
  3. Enter the following body:
{
  "text": "line one\nline two"
}
  1. Send the request

Expected behavior
The body is sent with \n as an escape sequence, resulting in valid JSON that the server can parse correctly.

Actual behavior
The body is sent with a literal newline character inside the string, producing invalid JSON. The server returns:

{
  "error": "Invalid JSON",
  "debug": "Control character error, possibly incorrectly encoded"
}

Workaround
Using PowerShell with ConvertTo-Json correctly escapes the newline and the request succeeds. This confirms the issue is in Yaade's body editor, not the server.

Environment

  • Yaade version: latest (issue persists after updating)
  • OS: Windows
  • Browser: Chrome

Additional context
Tools like Postman and Bruno handle \n correctly as an escape sequence in the body editor. It would be great if Yaade did the same.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions