mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
docs: mention issues with buffer encoding (#12141)
This commit is contained in:
parent
168856ec87
commit
00fa75ec9e
@ -17,3 +17,7 @@ class HTTPResponse {
|
||||
**Returns:**
|
||||
|
||||
Promise<Buffer>
|
||||
|
||||
## Remarks
|
||||
|
||||
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.
|
||||
|
@ -171,7 +171,7 @@ The status text of the response (e.g. usually an "OK" for a success).
|
||||
|
||||
</td><td>
|
||||
|
||||
Promise which resolves to a text representation of response body.
|
||||
Promise which resolves to a text (utf8) representation of response body.
|
||||
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
|
@ -4,7 +4,7 @@ sidebar_label: HTTPResponse.text
|
||||
|
||||
# HTTPResponse.text() method
|
||||
|
||||
Promise which resolves to a text representation of response body.
|
||||
Promise which resolves to a text (utf8) representation of response body.
|
||||
|
||||
#### Signature:
|
||||
|
||||
|
@ -81,11 +81,18 @@ export abstract class HTTPResponse {
|
||||
|
||||
/**
|
||||
* Promise which resolves to a buffer with response body.
|
||||
*
|
||||
* @remarks
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
abstract buffer(): Promise<Buffer>;
|
||||
|
||||
/**
|
||||
* Promise which resolves to a text representation of response body.
|
||||
* Promise which resolves to a text (utf8) representation of response body.
|
||||
*/
|
||||
async text(): Promise<string> {
|
||||
const content = await this.buffer();
|
||||
|
Loading…
Reference in New Issue
Block a user