queueResponse method

void queueResponse (Response resp, { Duration delay: null })

Adds an HTTP response to the list of responses to be returned.

A queued response will be returned for the next HTTP request made to this instance and will then be removed. You may queue up as many responses as you like and they will be returned in order. If a delay is set in this method it will take precedence over defaultDelay. If delay isn't set or is explicitly set to null, defaultDelay will be used.


void queueResponse(Response resp, {Duration delay: null}) {
  _responseQueue.add(new _MockServerResponse(resp, delay));