HttpHeaderResponse

A partial HTTP response which only includes the status and header data, but no response body.

一个部分 HTTP 请求,它只包括状态和响应头数据,但没有响应体。

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

说明

HttpHeaderResponse is a HttpEvent available on the response event stream, only when progress events are requested.

HttpHeaderResponse 是一个可用于响应事件流的 HttpEvent,只有在要求了进度事件时才有效。

构造函数

Create a new HttpHeaderResponse with the given parameters.

根据给定的参数创建新的 HttpHeaderResponse 对象。

constructor(init: { headers?: HttpHeaders; status?: number; statusText?: string; url?: string; } = {})

参数

init

Type: { headers?: HttpHeaders; status?: number; statusText?: string; url?: string; }.

可选. 默认值是 {}.

属性

属性名类型说明
type只读

方法

Copy this HttpHeaderResponse, overriding its contents with the given parameter hash.

复制这个 HttpHeaderResponse,使用给定的参数哈希对象覆盖其内容。

clone(update: { headers?: HttpHeaders; status?: number; statusText?: string; url?: string; } = {}): HttpHeaderResponse

参数

update

Type: { headers?: HttpHeaders; status?: number; statusText?: string; url?: string; }.

可选. 默认值是 {}.

返回值

HttpHeaderResponse