Examples of followRedirects()


Examples of com.google.appengine.api.urlfetch.FetchOptions.followRedirects()

                    else
                        fetchOptions.disallowTruncate();
                    break;
                case "followRedirects":
                    if (DefaultGroovyMethods.asBoolean(value))
                        fetchOptions.followRedirects();
                    else
                        fetchOptions.doNotFollowRedirects();
                    break;
                case "deadline":
                    fetchOptions.setDeadline(((Number)value).doubleValue());
View Full Code Here

Examples of com.google.appengine.api.urlfetch.FetchOptions.followRedirects()

    @Test
    public void testFollowRedirects() throws Exception {
        final URL redirect = getUrl("redirect");
        FetchOptions options = buildFetchOptions();
        options.followRedirects();
        testOptions(redirect, options, new ResponseHandler() {
            public void handle(HTTPResponse response) throws Exception {
                URL finalURL = response.getFinalUrl();
                Assert.assertEquals(getUrl(""), finalURL);
            }
View Full Code Here

Examples of org.apache.wink.client.ApacheHttpClientConfig.followRedirects()

        log.debug("Opening w/username: {}", username);

        // Using Apache HttpClient here, as it appears the default wink client does not handle redirects properly, even when configured to do so
        HttpClient httpClient = new DefaultHttpClient();
        ClientConfig config = new ApacheHttpClientConfig(httpClient);
        config.followRedirects(true);

        config.handlers(
            new LoggingHandler(log, /*debug*/ false),
            new BasicAuthSecurityHandler(username, password)
        );
View Full Code Here

Examples of org.apache.wink.client.ClientConfig.followRedirects()

    public void testConfiguration() {
        ClientConfig conf = new ClientConfig();
        conf.proxyHost("localhost").proxyPort(8080);
        conf.connectTimeout(6000);
        conf.followRedirects(true);

        assertEquals(conf.getProxyHost(), "localhost");
        assertEquals(conf.getProxyPort(), 8080);
        assertEquals(conf.getConnectTimeout(), 6000);
        assertEquals(conf.isFollowRedirects(), true);
View Full Code Here

Examples of org.apache.wink.client.ClientConfig.followRedirects()

        log.debug("Opening w/username: {}", username);

        // Using Apache HttpClient here, as it appears the default wink client does not handle redirects properly, even when configured to do so
        HttpClient httpClient = new DefaultHttpClient();
        ClientConfig config = new ApacheHttpClientConfig(httpClient);
        config.followRedirects(true);

        config.handlers(
            new LoggingHandler(log, /*debug*/ false),
            new BasicAuthSecurityHandler(username, password)
        );
View Full Code Here

Examples of org.eclipse.jetty.client.HttpRequest.followRedirects()

            }
            else {
                jettyRequest.content(new BodyGeneratorContentProvider(bodyGenerator, httpClient.getExecutor()));
            }
        }
        jettyRequest.followRedirects(finalRequest.isFollowRedirects());
        return jettyRequest;
    }

    public List<HttpRequestFilter> getRequestFilters()
    {
View Full Code Here

Examples of org.eclipse.jetty.client.api.Request.followRedirects()

        }
        final URI uri = clientRequest.getUri();
        final Request request = client.newRequest(uri);
        request.method(method);

        request.followRedirects(clientRequest.resolveProperty(ClientProperties.FOLLOW_REDIRECTS, true));
        final Object readTimeout = clientRequest.getConfiguration().getProperties().get(ClientProperties.READ_TIMEOUT);
        if (readTimeout != null && readTimeout instanceof Integer && (Integer) readTimeout > 0) {
            request.timeout((Integer) readTimeout, TimeUnit.MILLISECONDS);
        }
        return request;
View Full Code Here

Examples of org.jboss.resteasy.client.ClientRequest.followRedirects()

      request.getAttributes().putAll(attributes);
      if (accepts != null) request.header(HttpHeaders.ACCEPT, accepts.toString());
      this.copyClientInterceptorsTo(request);

      boolean isClientResponseResult = ClientResponse.class.isAssignableFrom(method.getReturnType());
      request.followRedirects(!isClientResponseResult || this.followRedirects);

      for (int i = 0; i < marshallers.length; i++)
      {
         marshallers[i].build(request, args[i]);
      }
View Full Code Here

Examples of org.jboss.resteasy.client.ClientRequest.followRedirects()

      for (int i = 0; i < registration.getMaxRetries(); i++)
      {
         long wait = registration.getRetryWaitMillis();
         System.out.println("Creating request from " + uri);
         ClientRequest request = executor.createRequest(uri);
         request.followRedirects(false);
         HornetQRestLogger.LOGGER.debug("Created request " + request);

         for (XmlHttpHeader header : registration.getHeaders())
         {
            HornetQRestLogger.LOGGER.debug("Setting XmlHttpHeader: " + header.getName() + "=" + header.getValue());
View Full Code Here

Examples of org.jboss.resteasy.client.ClientRequest.followRedirects()

      String uri = createUri(message);
      for (int i = 0; i < registration.getMaxRetries(); i++)
      {
         long wait = registration.getRetryWaitMillis();
         ClientRequest request = executor.createRequest(uri);
         request.followRedirects(false);

         for (XmlHttpHeader header : registration.getHeaders())
         {
            request.header(header.getName(), header.getValue());
         }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.