Skip to main content
Version: 24.38.0

HTTPResponse.content() 方法

🌐 HTTPResponse.content() method

Promise 解析为带有响应正文的缓冲区。

🌐 Promise which resolves to a buffer with response body.

语法

🌐 Signature

class HTTPResponse {
abstract content(): Promise<Uint8Array>;
}

返回:

Promise<Uint8Array>

附注

🌐 Remarks

浏览器可能会根据 HTTP 头或其他启发式方法重新编码缓冲区。如果浏览器未能检测到正确的编码,缓冲区可能会被编码错误。请参阅 https://github.com/puppeteer/puppeteer/issues/6478。

🌐 The buffer might be re-encoded by the browser based on HTTP-headers or other heuristics. If the browser failed to detect the correct encoding, the buffer might be encoded incorrectly. See https://github.com/puppeteer/puppeteer/issues/6478.