A cross-browser implementation for sending data over the supplied XHR connection.
npm install --save xhr-send
The module requires 3 arguments:
xhr
The reference to your constructedXMLHttpRequest
instance.data
The data that needs to be sent.fn
Completion callback that receives the error as first argument.
var send = require('xhr-send');
send(xhr, 'data', function (err) {
if (err) return console.error('failed to send because of reasons', err);
console.log('sent without any issues.');
});