RecordingEngine

class RecordingEngine(wrapped: <Error class: unknown class>)

An HttpClientEngine implementation that can be used to record requests and responses from a "live" connection by wrapping an existing engine. This is useful for capturing actual responses from a service, dumping them to json via toJson and then later being able to replay them as part of a test connection (see TestConnection.fromJson).

NOTE: This will not likely work correctly for streaming requests and responses. This is mostly for simple request-response pairs where the body can be read all at once.

Parameters

wrapped

The "real" engine to wrap and record requests and responses from

Constructors

Link copied to clipboard
constructor(wrapped: <Error class: unknown class>)

Functions

Link copied to clipboard
open suspend fun roundTrip(context: <Error class: unknown class>, request: <Error class: unknown class>): <Error class: unknown class>
Link copied to clipboard
fun toJson(): String