HTTPResponse.json() 方法
¥HTTPResponse.json() method
Promise 解析为响应正文的 JSON 表示形式。
¥Promise which resolves to a JSON representation of response body.
签名
¥Signature
class HTTPResponse {
json(): Promise<any>;
}
Returns:
Promise<any>
备注
¥Remarks
如果响应正文无法通过 JSON.parse
进行解析,则此方法将抛出异常。
¥This method will throw if the response body is not parsable via JSON.parse
.