Examples of HttpClient


Examples of br.net.woodstock.rockframework.net.http.HttpClient

        }
        if (first) {
          first = false;
        }
      }
      HttpClient client = new HttpClient();
      byte[] bytes = client.doGet(builder.toString());
      resp.getOutputStream().write(bytes);
    } catch (HttpException e) {
      throw new ServletException(e);
    }
  }
View Full Code Here

Examples of com.amazonaws.http.HttpClient

    public AmazonS3Client(AWSCredentials awsCredentials, ClientConfiguration clientConfiguration) {
        super(clientConfiguration);
        this.awsCredentials = awsCredentials;

        setEndpoint(Constants.S3_HOSTNAME);
        client = new HttpClient(clientConfiguration);

        requestHandlers = new HandlerChainFactory().newRequestHandlerChain(
                "/com/amazonaws/services/s3/request.handlers");
    }
View Full Code Here

Examples of com.atlassian.httpclient.api.HttpClient

    private final JiraRestClient jiraRestClient;
    private final OesbAsynchronousUserRestClient userRestClient;

    public RestJiraClient(URI serverUri, String username, String password) {
        final URI baseUri = UriBuilder.fromUri(serverUri).path("/rest/api/latest").build();
        final HttpClient httpClient =
            new AsynchronousHttpClientFactory().createClient(serverUri, new BasicHttpAuthenticationHandler(username,
                    password));
        jiraRestClient = new AsynchronousJiraRestClientFactory().create(serverUri, httpClient);
        userRestClient = new OesbAsynchronousUserRestClient(baseUri, httpClient);
    }
View Full Code Here

Examples of com.cisco.oss.foundation.http.HttpClient


    public static HttpClient<HttpRequest,JettyHttpResponse> createHttpClient(String apiName, LoadBalancerStrategy.STRATEGY_TYPE highAvailabilityStrategyType, Configuration configuration, boolean enableLoadBalancing){
        ConfigurationFactory.getConfiguration();
        try {
            HttpClient client = null;
            if(highAvailabilityStrategyType == null){
                client = new JettyHttpClient(apiName, configuration, enableLoadBalancing);
            }else{
                client = new JettyHttpClient(apiName, highAvailabilityStrategyType, configuration, enableLoadBalancing);
            }
View Full Code Here

Examples of com.consol.citrus.http.client.HttpClient

        Map<String, HttpClient> clients = beanDefinitionContext.getBeansOfType(HttpClient.class);

        Assert.assertEquals(clients.size(), 4);

        // 1st message sender
        HttpClient httpClient = clients.get("httpClient1");
        Assert.assertNotNull(httpClient.getEndpointConfiguration().getRestTemplate());
        Assert.assertEquals(httpClient.getEndpointConfiguration().getRequestUrl(), "http://localhost:8080/test");
        Assert.assertEquals(httpClient.getEndpointConfiguration().getRestTemplate().getRequestFactory().getClass(), InterceptingClientHttpRequestFactory.class);
        Assert.assertNotNull(httpClient.getEndpointConfiguration().getClientInterceptors());
        Assert.assertEquals(httpClient.getEndpointConfiguration().getClientInterceptors().get(0).getClass(), LoggingClientInterceptor.class);
        Assert.assertEquals(httpClient.getEndpointConfiguration().getRequestMethod(), HttpMethod.POST);
        Assert.assertEquals(httpClient.getEndpointConfiguration().getCorrelator().getClass(), DefaultMessageCorrelator.class);
        Assert.assertEquals(httpClient.getEndpointConfiguration().getTimeout(), 5000L);


        // 2nd message sender
        httpClient = clients.get("httpClient2");
        Assert.assertNotNull(httpClient.getEndpointConfiguration().getRestTemplate());
        Assert.assertEquals(httpClient.getEndpointConfiguration().getRequestUrl(), "http://localhost:8080/test");
        Assert.assertEquals(httpClient.getEndpointConfiguration().getRestTemplate().getRequestFactory().getClass(), InterceptingClientHttpRequestFactory.class);
        Assert.assertEquals(httpClient.getEndpointConfiguration().getRequestMethod(), HttpMethod.GET);
        Assert.assertEquals(httpClient.getEndpointConfiguration().getCorrelator().getClass(), DefaultMessageCorrelator.class);
        Assert.assertEquals(httpClient.getEndpointConfiguration().getContentType(), "text/xml");
        Assert.assertEquals(httpClient.getEndpointConfiguration().getCharset(), "ISO-8859-1");
        Assert.assertEquals(httpClient.getEndpointConfiguration().getMessageConverter(), beanDefinitionContext.getBean("messageConverter"));
        Assert.assertEquals(httpClient.getEndpointConfiguration().getEndpointUriResolver(), beanDefinitionContext.getBean("endpointResolver"));
        Assert.assertEquals(httpClient.getEndpointConfiguration().getTimeout(), 10000L);

        // 3rd message sender
        httpClient = clients.get("httpClient3");
        Assert.assertNotNull(httpClient.getEndpointConfiguration().getRestTemplate());
        Assert.assertEquals(httpClient.getEndpointConfiguration().getRestTemplate(), beanDefinitionContext.getBean("restTemplate"));
        Assert.assertEquals(httpClient.getEndpointConfiguration().getRequestUrl(), "http://localhost:8080/test");
        Assert.assertNotNull(httpClient.getEndpointConfiguration().getCorrelator());
        Assert.assertEquals(httpClient.getEndpointConfiguration().getCorrelator(), beanDefinitionContext.getBean("replyMessageCorrelator"));

        // 4th message sender
        httpClient = clients.get("httpClient4");
        Assert.assertNotNull(httpClient.getActor());
        Assert.assertEquals(httpClient.getActor(), beanDefinitionContext.getBean("testActor", TestActor.class));
        Assert.assertEquals(httpClient.getEndpointConfiguration().getRestTemplate().getRequestFactory().getClass(), InterceptingClientHttpRequestFactory.class);
        Assert.assertNotNull(httpClient.getEndpointConfiguration().getClientInterceptors());
        Assert.assertEquals(httpClient.getEndpointConfiguration().getClientInterceptors().get(0), beanDefinitionContext.getBean("clientInterceptor"));
        Assert.assertEquals(httpClient.getEndpointConfiguration().getPollingInterval(), 250L);
    }
View Full Code Here

Examples of com.davfx.ninio.http.HttpClient

  public AllAvailableScriptRunner() throws IOException {
    queue = new Queue();
    executorScriptRunner = new ExecutorScriptRunner();
   
    http = new HttpClient(queue, null);
   
    telnet = new WaitingTelnetClientCache(queue);
   
    ssh = new WaitingTelnetClientCache(queue);
    ssh.override(new SshTelnetConnectorFactory());
View Full Code Here

Examples of com.dotcms.repackage.org.apache.commons.httpclient.HttpClient

          }
      }).when(req).setAttribute(Mockito.eq("requestCode"),Mockito.any(String.class));

      LicenseUtil.processForm(req);
     
      HttpClient client=new HttpClient();
      PostMethod post=new PostMethod("https://my.dotcms.com/app/licenseRequest3");
      post.setRequestBody(new NameValuePair[] { new NameValuePair("code", reqcode.toString()) });
      client.executeMethod(post);
     
      if(post.getStatusCode()==200){
        license = post.getResponseBodyAsString();
        HttpServletRequest req2=Mockito.mock(HttpServletRequest.class);
        Mockito.when(req2.getParameter("iwantTo")).thenReturn("paste_license");
View Full Code Here

Examples of com.dragontek.mygpoclient.http.HttpClient

    this._client.setCookieStore(cookieStore);
  }

  public boolean authenticate(String username, String password) {
    if (username != null && password != null) {
      HttpClient tempClient = new HttpClient(username, password);
      try {
        tempClient.POST(_locator.loginUri(), null);
        for (Cookie c : tempClient.getCookieStore().getCookies()) {
          if (c.getName().equals("sessionid"))
            ;
          _authToken = c.getValue().toString();
        }
      } catch (Exception e) {
View Full Code Here

Examples of com.facebook.presto.jdbc.internal.jetty.client.HttpClient

            path += "?" + query;
        HttpGenerator.RequestInfo requestInfo = new HttpGenerator.RequestInfo(request.getVersion(), request.getHeaders(), contentLength, request.getMethod(), path);

        try
        {
            HttpClient client = getHttpChannel().getHttpDestination().getHttpClient();
            ByteBufferPool bufferPool = client.getByteBufferPool();
            ByteBuffer header = bufferPool.acquire(client.getRequestBufferSize(), false);
            ByteBuffer chunk = null;

            ByteBuffer contentBuffer = null;
            boolean lastContent = false;
            if (!expects100Continue(request))
View Full Code Here

Examples of com.github.kristofa.test.http.client.HttpClient

            }

        }

        private HttpClientResponse<InputStream> forward(final FullHttpRequest request) throws HttpRequestException {
            final HttpClient client = new ApacheHttpClientImpl();
            return client.execute(request);
        }
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.