navigator.sendBeacon() sending Ping request

Viewed 247

I want to send a POST request to server with an object in request body.

 let blob =  new Blob([JSON.stringify({
            id: _ID,
          }, null, 2)], {type : 'application/json'});
      
navigator.sendBeacon(http://url.com/API,blob);

This is a pending call with request body not being shown. ping

body

Is the approach right to send a POST call with request body with beacon?

Thanks in advance.

0 Answers
Related