Service worker ionic store body request http

I have this interface that contains a save button. This button has role to send a post request to the server.
What I am looking for is to use service worker to store the request’s body.
When the device is connected to the network, it will fetch the data automatically from the service worker and resend the request.

Is this possible ?