Once you sent a HTTP request, you cannot cancel it any more from the
client side. You could send a second request to the server to cancel
the previous request but that can lead to very unpleasant effects,
e.g. when a cancel request arrives before the original one. 

So either don't fire the original request or make the server robust
enough for all request.

Marc


--- In [email protected], "Dmitri Girski" <mite...@...> wrote:
>
> Hi everybody,
> 
> How can I cancel the http request? Is there a way to close the
> underlying socket?
> I've got a situation when first HTTP request is in progress
> (waiting/receiving the results), and I have to fetch the data again,
> as I know that the dataset I am expecting to get is already obsolete. 
> 
> I tried to do this:
> 
> requst.cancel();
> request.disconnect();
> request = new HTTPService() 
> 
> But looking at the server logs I can see that connection is still
> there and backend performs everything it has to and closes the
> connection only when all data is sent. (Apache is at the backend) 
> 
> Any comments or help is appreciated!
> 
> Thanks!
> 
> Cheers,
> Dmitri.
>


Reply via email to