This is not complicated, especially being Web-based.
All client environment environments have a Storage area - even browsers . Usually these storage areas work simply with key and value - key value .
You can implement something like the following pseudo code:
sendData = (data) => {
_http.send(data,
(response) => { success(response); },
(error) => { _retryStorage.add(data); });
};
So, having a service periodically doing something like:
var data = _retryStorage.pop();
data && sendData(data);
So, if you have not been able to send the data to the server, then throw it into storage to get it back. Then another asynchronous service will "listen" to this queue, and if you have something there, try to re-send.
Remember that this is just a pseudo code, there is a lot to develop to work as expected, but it's a good way to go.