Hi: I want to close the underlying connection if the status code of response is not 2XX, or I don't want the connection to be reused if any request on it has ever failed. how? I am using httpasyncclient 4.0.2.
why I want to do this? Because in some situations my server may return error right after it finished receiving the http headers while the body is not completed. And the client may stop sending body if it receive the response. And if the connection is reused by another request, the data of http header of the new request may consider to be the rest body data of the last request. Then the second request will fail with an unexpected exception. My solution to this problem is: don't reuse the connection if any request has failed it.
