Skip to content
Response

玩法 / Response

Response Interface
​

HTTP响应信息的对象

Table of contents ​

Properties
​

headers: Map<string, string>
响应头
ok: boolean
是否成功(状态码是否为200)
status: number
响应状态码
type: string
响应类型
url: string
响应URL

Methods
​

json<T: >(): Promise<T: >
数据返回json
text(): Promise<string>
数据返回文本

Properties ​

headers
​

• headers: Map<string, string>

响应头


ok
​

• ok: boolean

是否成功(状态码是否为200)


status
​

• status: number

响应状态码


type
​

• type: string

响应类型


url
​

• url: string

响应URL

Methods ​

json
​

• json<T>(): Promise<T>

数据返回json

Returns ​

Promise<T>数据返回json

Type parameters ​

Name
T

text
​

• text(): Promise<string>

数据返回文本

Returns ​

Promise<string>数据返回文本