This page is Ready to Use

Notice: The WebPlatform project, supported by various stewards between 2012 and 2015, has been discontinued. This site is now available on github.

binaryType

Summary

Indicates the type of binary data being transmitted by the connection.

Property of apis/websocket/WebSocketapis/websocket/WebSocket

Syntax

var result = element.binaryType;
element.binaryType = value;

Return Value

Returns an object of type StringString

Examples

socket.binaryType = "blob";
// receive some blob data

socket.binaryType = "arraybuffer";
// now receive ArrayBuffer data

Notes

Acceptable values are “arrayBuffer” and "blob".

Related specifications

W3C WebSocket Specification
W3C Candidate Recommendation

Attributions