Package-level declarations

Helper methods and structures for performing HTTP requests.

Types

Link copied to clipboard
data class ServerSentEvent(val type: String, val data: String, val id: String?)

A single event read from a Server-Sent Events (SSE) stream.

Link copied to clipboard
class SseReader(source: BufferedSource)

Reads ServerSentEvents from an HTTP response body in the text/event-stream format.

Properties

Link copied to clipboard

The event type used for events without an explicit event: field.

Functions

Link copied to clipboard
fun <TEntity : Any> Response.entitySequence(serializer: Serializer, separatorBytes: ByteString, bufferSize: Int, entityType: Class<TEntity>): Sequence<TEntity>

Streams deserialized entities from an HTTP response body.

Link copied to clipboard
fun Response.retryAfterDuration(): Duration?

Returns the relative waiting time extracted from the Retry-After header if any.

Link copied to clipboard
fun Response.sseReader(): SseReader

Reads the response body as a Server-Sent Events (SSE) stream.