Is there expectation if client cancels http post r...
# random
u
Is there expectation if client cancels http post request, that server will cancel its action and revert transactions?
t
In relation to a specific tech or in general?
u
in general, if client cancels POST postMessage, wether should server cancel & rollback transaction of that if not finished yet
c
How do you cancel a POST?
u
well, I mean canceling okhttp Request, whatever that means, probably closing the socket
h
I think the questions here reveal the answer. In general, noone will expect you to try a rollback. If the POST request is already fired off and the client changes his mind before receiving an answer, let that be the client's problem and do not roll back anything on the server.
u
But why? Because its better, or because its hard to do on backend so they dont bother?
h
The way I see it, since the client cannot know what procedures go on on the server side and cannot even know if the cancelling of the request took place before the server had time to do anything or after a reply had already been sent, I would expect the client to expect the server to have done lots of stuff and not roll back. It's just a pragmatic approach.
c
My point was that since POST cannot be canceled at the HTTP level, it needs to be a separate API call. And obviously, in that separate API call, the server will perform the revert operation.
u
It doesnt? Okay im not an expert. Okay thanks guys