If you want to cancel the request on the server side, just return a response.
In case you want to kill the thread that is currently doing REST request, just kill the thread.
REST is stateless means that the web server does not store any state about the client application/session state. The session is stored on the client. The server is stateless means that every server can service any client at any time, there is no session affinity or sticky sessions. The relevant session information is stored on the client and passed to the server as needed.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…