填写这份《一分钟调查》,帮我们(开发组)做得更好!去填写Home

HttpResponse

一个完整的 HTTP 响应对象,包括一个带类型的响应体(如果没返回内容,则为 null)。

A full HTTP response, including a typed response body (which may be null if one was not returned).

查看"说明"...

      
      class HttpResponse<T> extends HttpResponseBase {
  constructor(init: { body?: T; headers?: HttpHeaders; status?: number; statusText?: string; url?: string; } = {})
  body: T | null
  type: HttpEventType.Response
  clone(update: { body?: any; headers?: HttpHeaders; status?: number; statusText?: string; url?: string; } = {}): HttpResponse<any>

  // 继承自 common/http/HttpResponseBase
  constructor(init: { headers?: HttpHeaders; status?: number; statusText?: string; url?: string; }, defaultStatus: number = 200, defaultStatusText: string = 'OK')
  headers: HttpHeaders
  status: number
  statusText: string
  url: string | null
  ok: boolean
  type: HttpEventType.Response | HttpEventType.ResponseHeader
}
    

说明

HttpResponse 是一个用于事件响应流的 HttpEvent

HttpResponse is a HttpEvent available on the response event stream.

构造函数

构造一个新的 HttpResponse

Construct a new HttpResponse.

constructor(init: { body?: T; headers?: HttpHeaders; status?: number; statusText?: string; url?: string; } = {})
      
      constructor(init: { body?: T; headers?: HttpHeaders; status?: number; statusText?: string; url?: string; } = {})
    
参数
init object

可选. 默认值是 {}.

属性

属性说明
body: T | null只读

响应体,如果没有返回内容则为 null

The response body, or null if one was not returned.

type: HttpEventType.Response只读

方法

Overload #1
clone(): HttpResponse<T>
      
      clone(): HttpResponse<T>
    
参数

没有参数。

返回值

HttpResponse<T>


Overload #2
clone(update: { headers?: HttpHeaders; status?: number; statusText?: string; url?: string; }): HttpResponse<T>
      
      clone(update: { headers?: HttpHeaders; status?: number; statusText?: string; url?: string; }): HttpResponse<T>
    
参数
update object
返回值

HttpResponse<T>


Overload #3
clone<V>(update: { body?: V; headers?: HttpHeaders; status?: number; statusText?: string; url?: string; }): HttpResponse<V>
      
      clone<V>(update: { body?: V; headers?: HttpHeaders; status?: number; statusText?: string; url?: string; }): HttpResponse<V>
    
参数
update object
返回值

HttpResponse<V>