This is the archived documentation for Angular v6. Please visit angular.io to see documentation for the current version of Angular.

XHRConnection

Creates connections using XMLHttpRequest. Given a fully-qualified request, an XHRConnection will immediately create an XMLHttpRequest object and send the request.

See more...

Deprecated: see https://angular.io/guide/http

      
      class XHRConnection implements Connection {
  constructor(req: Request, browserXHR: BrowserXhr, baseResponseOptions?: ResponseOptions)
  request: Request
  response: Observable<Response>
  readyState: ReadyState
  setDetectedContentType(req: any, _xhr: any)
}
    

Description

This class would typically not be created or interacted with directly inside applications, though the MockConnection may be interacted with in tests.

Constructor

constructor(req: Request, browserXHR: BrowserXhr, baseResponseOptions?: ResponseOptions)
      
      constructor(req: Request, browserXHR: BrowserXhr, baseResponseOptions?: ResponseOptions)
    

Parameters

req

Type: Request.

browserXHR

Type: BrowserXhr.

baseResponseOptions

Type: ResponseOptions.

Optional. Default is undefined.

Properties

Property Description
request: Request
response: Observable<Response>

Response EventEmitter which emits a single Response value on load event of XMLHttpRequest.

readyState: ReadyState

Methods

setDetectedContentType(req: any, _xhr: any)
      
      setDetectedContentType(req: any, _xhr: any)
    

Parameters

req

Type: any.

_xhr

Type: any.