defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.33/modules/angular2/src/http/backends/mock_backend.ts#L8-L99">angular2/src/http/backends/mock_backend.ts (line 8)</a>
Describes the state of the connection, based on `XMLHttpRequest.readyState`, but with
additional states. For example, state 5 indicates an aborted connection.
.l-sub-section
h3 request
:markdown
<a href='Request-class.html'><code>Request</code></a> instance used to create the connection.
.l-sub-section
h3 response
:markdown
<a href='../core/EventEmitter-class.html'><code>EventEmitter</code></a> of <a href='Response-class.html'><code>Response</code></a>. Can be subscribed to in order to be notified when a
response is available.
.l-sub-section
h3 dispose
pre.prettyprint
code.
dispose()
:markdown
Changes the `readyState` of the connection to a custom state of 5 (cancelled).
.l-sub-section
h3 mockRespond
pre.prettyprint
code.
mockRespond(res: Response)
:markdown
Sends a mock response to the connection. This response is the value that is emitted to the
<a href='../core/EventEmitter-class.html'><code>EventEmitter</code></a> returned by <a href='Http-class.html'><code>Http</code></a>.
Sends the provided <a href='Response-class.html'><code>Response</code></a> to the `downloadObserver` of the `Request`
associated with this connection.
.l-sub-section
h3 mockError
pre.prettyprint
code.
mockError(err?: Error)
:markdown
Emits the provided error object as an error to the <a href='Response-class.html'><code>Response</code></a> <a href='../core/EventEmitter-class.html'><code>EventEmitter</code></a>
returned
from <a href='Http-class.html'><code>Http</code></a>.