Vipul Panth Vipul Panth - 7 months ago 62
Javascript Question

Navigator.sendBeacon() to pass header information

I am using navigator for communicating with the server , but problem is that we need to pass some header information as there is filter which recognise the request is from the valid source.

Can anybody help on this?



After searching for an answer for this question i found out that for passing header with navigator we need to pass a blob object.

For example

var hearders = {type : 'application/json'};
var blob = new blob(request , headers);