highlight Body
fun highlightBody(body: String, contentType: ContentType, useColor: Boolean = isColorSupported()): String(source)
Applies ANSI color highlighting to an HTTP body string based on its content type.
Return
The highlighted body string with ANSI color codes.
Parameters
body
The HTTP body content to highlight.
content Type
The content type of the body.
Applies ANSI color highlighting to a JsonElement for terminal output.
Produces pretty-printed output by walking the element tree directly — no intermediate JSON string, no heuristic scanning.
Return
The highlighted JSON string.
Parameters
body
The JsonElement to highlight.
use Color
Whether to apply ANSI color codes.