Skip to main content
Version: Next

HTTPRequest.content() method

Fetches the POST data for the request from the browser as a Uint8Array.

Signature​

class HTTPRequest {
abstract content(): Promise<Uint8Array | undefined>;
}

Returns:

Promise<Uint8Array | undefined>

A promise that resolves to the raw POST data bytes, or undefined when the request has no POST data or fetching it fails.

Remarks​

If the request has no POST data or fetching the POST data from the browser fails, this method resolves to undefined.