XHRConnection

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

查看"说明"...

已弃用: 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)
}
    

说明

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

构造函数

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

可选. 默认值是 undefined.

属性

属性说明
request: Request
response: Observable<Response>

Response EventEmitterwhich emits a single Responsevalue on load event of XMLHttpRequest.

readyState: ReadyState

方法

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