setData(data): Set the current beacon data. The data argument would take the same types as the sendBeacon method’s data parameter. That is, one of ArrayBuffer, ArrayBufferView, Blob, string, FormData, or URLSearchParams.
The current proposal doesn't differentiate between GET/POST for the beacon data. But most of them just don't make sense for GET request in term of url encoding, e.g. Blob, ArrayBuffer, ArrayBufferView, and FormData can contain arbitrary bytes which is difficult to encode in url.
Would it make sense to specify beacon data from setData(data) only works for POST?
The current proposal doesn't differentiate between GET/POST for the beacon data. But most of them just don't make sense for GET request in term of url encoding, e.g.
Blob,ArrayBuffer,ArrayBufferView, andFormDatacan contain arbitrary bytes which is difficult to encode in url.Would it make sense to specify beacon data from
setData(data)only works for POST?