Dear Oleg,
Thanks for your answer – exactly what I needed.
Best regards,
Kaspar
olegk wrote:
>
> On Thu, 2010-08-12 at 07:51 -0700, hbfkf wrote:
>> Hi everybody,
>>
>> I am trying to get the URL from within a HttpRequestRetryHandler in
>> HttpClient 4. Is there a supported way to achieve this?
>>
>
> I assume by URL you mean the request URI
>
> ---
> DefaultHttpClient httpclient = new DefaultHttpClient();
> httpclient.setHttpRequestRetryHandler(new
> DefaultHttpRequestRetryHandler() {
>
> @Override
> public boolean retryRequest(
> IOException exception, int executionCount, HttpContext
> context) {
> HttpRequest request = (HttpRequest)
> context.getAttribute(ExecutionContext.HTTP_REQUEST);
> System.out.println(request.getRequestLine().getUri());
> HttpHost target = (HttpHost)
> context.getAttribute(ExecutionContext.HTTP_TARGET_HOST);
> System.out.println(target);
> return super.retryRequest(exception, executionCount, context);
> }
>
> });
> ---
>
> Oleg
>
>
>
--
View this message in context:
http://old.nabble.com/Getting-URL-from-within-a-HttpRequestRetryHandler-tp29419562p29426542.html
Sent from the HttpClient-User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]