HTTP (1.0 / 1.1) has no means to cancel a request. All the client can do if he no longer wants an answer is to close the connection and hope that the server contains optimizations to stop working on the answer, which can no longer be delivered. Since the connection is now closed, no response or status code can be sent to the client, so any code that you "return" is intended only for your own satisfaction. I would personally choose something in the 4xx 1 range since the “error” is the reason you can no longer deliver the answer is related to the client.
HTTP 2.0 END_STREAM
RST_STREAM
, , . , , HEADERS
DATA
, , , , .
1 , 400, , .