bookmark

Apache HttpClient 4.5 Redirect Handling Requests Example


Description

HttpClientContext context = HttpClientContext.create(); HttpGet httpGet = new HttpGet("http://httpbin.org/redirect/3"); System.out.println("Executing request " + httpGet.getRequestLine()); System.out.println("----------------------------------------"); httpclient.execute(httpGet, context); HttpHost target = context.getTargetHost(); List<URI> redirectLocations = context.getRedirectLocations();

Preview

Tags

Users

  • @jil

Comments and Reviews