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 = HttpStatusCode.Ok, 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.
构造函数
构造一个新的 Construct a new | |||
参数
|
属性
属性 | 说明 |
---|---|
body: T | null | 只读 响应体,如果没有返回内容则为 The response body, or |
type: HttpEventType.Response | 只读 |
方法
3 个重载形式...显示所有 隐藏所有 expand_moreOverload #1Overload #2
参数
返回值Overload #3
参数
返回值
|