takeRequest

fun takeRequest(timeout: Long = 2, unit: TimeUnit = TimeUnit.SECONDS): RecordedRequest

Awaits the next HTTP request (waiting up to the specified wait time if necessary), removes it from the queue, and returns it. Callers should use this to verify the request was sent as intended within the given time.

Parameters

timeout

How long to wait before giving up, in units of unit

unit

A TimeUnit determining how to interpret the timeout parameter