takeRequest

Awaits the next HTTP request, removes it, and returns it. Callers should use this to verify the request was sent as intended. This method will block until the request is available, possibly forever.

Return

the head of the request queue


fun takeRequest(timeout: Long, unit: TimeUnit): RecordedRequest?

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

Return

the head of the request queue

Parameters

timeout

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

unit

a TimeUnit determining how to interpret the timeout parameter