Docs API Client Body Editor

Body Editor

Full-featured code editor with syntax highlighting, code folding, smart keyboard, validation, and beautify for JSON, XML, GraphQL, and more.

Body Modes

ModeDescription
noneNo request body
rawFree-text code editor with language selection: JSON, XML, HTML, JavaScript, GraphQL, Plain Text
form-dataMultipart form data with per-row type selector (text or file). File picker button for uploads.
x-www-form-urlencodedURL-encoded key-value pairs with enable/disable toggle per row
binaryRaw binary file upload via file picker

Code Editor Features

The raw body editor is a full code editor with:

  • Syntax highlighting — Dedicated tokenizers for JSON, XML, HTML, JavaScript, and GraphQL with color-coded keywords, strings, numbers, booleans, and comments
  • Line numbers — Gutter with clickable line numbers
  • Code folding — Collapse JSON objects/arrays or XML tags by clicking fold toggles in the gutter. Folded regions show a summary badge. Hover over the gutter to reveal fold/unfold buttons.
  • Variable highlighting{{variables}} are highlighted inline: cyan for resolved variables, rose for unresolved ones

Smart Keyboard

The editor provides IDE-like keyboard behavior:

KeyBehavior
TabIndent selected lines (or insert spaces at cursor)
Shift+TabOutdent selected lines
EnterAuto-indent new line. Inside {} or [], expands with proper indentation on both sides.
Type {, [, (, ", 'Auto-closes the matching bracket/quote
Type }, ], )Skips over the existing closing character instead of doubling it
Backspace on empty pairDeletes both the opening and closing bracket/quote
Cmd+Shift+FBeautify / format the entire body
Cmd+DDuplicate the current line
Cmd+/Toggle line comment (JS-style // or XML <!-- -->)

Beautify / Format

Click the Beautify button or press Cmd+Shift+F to auto-format the body. Supported languages:

  • JSON — Parse and re-stringify with proper indentation
  • XML — Reformat with nested indentation, preserving attributes
  • JavaScript — Basic re-indentation and formatting

Body Validation

The editor validates your body in real-time and shows a validation bar at the bottom:

  • JSON — Parse errors with exact line number and error message. The error line is highlighted in the gutter.
  • JavaScript — Syntax errors via new Function() parsing
  • XML — DOM parser error detection
  • GraphQL — Bracket balance validation

A green checkmark indicates valid syntax; a red error bar shows the issue with a clickable line reference.

GraphQL

When the body language is set to GraphQL, the raw editor accepts standard GraphQL query syntax with dedicated syntax highlighting for queries, mutations, fields, arguments, and variables. Variables can be passed via the Params section or inline.

Last updated 4 hours ago