DeepSeekHeaders

class DeepSeekHeaders(entries: Map<String, List<String>>)

Immutable, Ktor-free snapshot of HTTP response headers attached to a DeepSeekException.

Provided so that error-handling code does not need to depend on io.ktor.http.Headers and remains stable across Ktor major versions.

Lookups are case-insensitive, matching RFC 7230 semantics. The order of names reflects the insertion order of the backing map.

Example:

try {
client.chat("hello")
} catch (e: DeepSeekException.RateLimitException) {
val retryAfterSeconds = e.headers["Retry-After"]?.toLongOrNull()
// honor retryAfterSeconds before retrying
}

Constructors

Link copied to clipboard
constructor(entries: Map<String, List<String>>)

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
operator fun contains(name: String): Boolean

Returns true if the header name is present (case-insensitive).

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
operator fun get(name: String): String?

Returns the first value associated with name using case-insensitive comparison, or null if the header is not present.

Link copied to clipboard
fun getAll(name: String): List<String>

Returns all values associated with name using case-insensitive comparison, or an empty list if the header is not present.

Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard

Returns true when there are no headers.

Link copied to clipboard
fun names(): Set<String>

Returns the set of header names as originally supplied (case preserved).

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