Highlighting

Functions

Link copied to clipboard
fun highlightBody(body: JsonElement, useColor: Boolean = isColorSupported()): String

Applies ANSI color highlighting to a JsonElement for terminal output.

fun highlightBody(body: String, contentType: ContentType, useColor: Boolean = isColorSupported()): String

Applies ANSI color highlighting to an HTTP body string based on its content type.

fun highlightBody(body: String, contentType: String, useColor: Boolean = isColorSupported()): String

Applies ANSI color highlighting to an HTTP body string for a content type given as a string.

Link copied to clipboard

Registers a custom content type to be treated as JSON for highlighting purposes.

Registers a custom content type (given as a string) to be treated as JSON.