Answer

class Answer(val status: Int, val headers: Map<String, List<String>>, val text: String)

A server's answer: its status, headers and body, as text and, when it is JSON, as body; when it is an RFC 9457 problem, as problem too, and when it answers a command, as its result.

Constructors

Link copied to clipboard
constructor(status: Int, headers: Map<String, List<String>>, text: String)

Properties

Link copied to clipboard
val body: JsonNode?

The body as JSON; null when it is empty or not JSON.

Link copied to clipboard
Link copied to clipboard

The body as the problem the server answered (application/problem+json), its members typed: the Problem.status, the error Problem.code, the Problem.violations, the rejected command's Problem.result, the aggregate's Problem.version, what a retry may do (Problem.retry, with Retry-After, seconds or an HTTP date, as Problem.retryAfter) and every other member as an extension, read as wow-client reads a peer's problem. Null when the answer is not a problem.

Link copied to clipboard

The result of the command the answer answers: a success's body, or the result of the problem it answered with (Problem.result); read as wow-client reads a peer's. Null when the answer holds none: a query's, say, or a problem met before the command had a ref.

Link copied to clipboard
val status: Int
Link copied to clipboard

Functions

Link copied to clipboard
fun header(name: String): String?

The first value of the header name, whatever its case; null when the answer has none.

Link copied to clipboard
open override fun toString(): String