Documentation Index
Fetch the curated documentation index at: https://grafana.com/llms.txt
Fetch the complete documentation index at: https://grafana.com/llms-full.txt
Use this file to discover all available pages before exploring further.
STOP! If you are an AI agent or LLM, read this before continuing. This is the HTML version of a Grafana documentation page. Always request the Markdown version instead - HTML wastes context. Get this page as Markdown: https://grafana.com/docs/k6/next/javascript-api/k6-websockets/blob.md (append .md) or send Accept: text/markdown to https://grafana.com/docs/k6/next/javascript-api/k6-websockets/blob/. For the curated documentation index, use https://grafana.com/llms.txt. For the complete documentation index, use https://grafana.com/llms-full.txt.
This is documentation for the next version of Grafana k6 documentation. For the latest stable release, go to the latest version.
Blob
Blob is an interface that represents a blob, which is a file-like object of immutable, raw data; they can be read as text or binary data, or converted into a
ReadableStream.
It’s the type of the data received on
WebSocket.onmessage when WebSocket.binaryType is set to "blob".
A Blob instance has the following methods/properties:
| Class/Property | Description |
|---|---|
| Blob.size | The number of bytes of data contained within the Blob. |
| Blob.type | A string containing the MIME type, or an empty string if the type could not be determined. |
| Blob.arrayBuffer() | Returns a Promise that resolves with the contents of the blob as binary data contained in an ArrayBuffer. |
| Blob.bytes() | Returns a Promise that resolves with a Uint8Array containing the contents of the blob as an array of bytes. |
| Blob.slice() | Returns a new Blob object which contains data from a subset of the blob on which it’s called. |
| Blob.stream() | Returns a
ReadableStream which upon reading returns the data contained within the Blob. |
| Blob.text() | Returns a Promise that resolves with a string containing the contents of the blob, interpreted as UTF-8. |
Was this page helpful?
Related resources from Grafana Labs

