public function RequestInterface::setResponse

Manually set a response for the request.

This method is useful for specifying a mock response for the request or setting the response using a cache. Manually setting a response will bypass the actual sending of a request.

Parameters

Response $response Response object to set:

bool $queued Set to TRUE to keep the request in a state of not having been sent, but queue the: response for send()

Return value

RequestInterface Returns a reference to the object.

1 method overrides RequestInterface::setResponse()
Request::setResponse in drupal/core/vendor/guzzle/http/Guzzle/Http/Message/Request.php
Manually set a response for the request.

File

drupal/core/vendor/guzzle/http/Guzzle/Http/Message/RequestInterface.php, line 290

Class

RequestInterface
Generic HTTP request interface

Namespace

Guzzle\Http\Message

Code

public function setResponse(Response $response, $queued = false);