Examples of executeMethod()


Examples of com.dotcms.repackage.org.apache.commons.httpclient.HttpClient.executeMethod()

      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.volantis.shared.net.http.client.HttpClient.executeMethod()

        DefaultRepresentation responseInfo = null;

        // execute request
        try {
            httpClient.executeMethod(method);
        } catch (IOException e) {
            throw new ResourceRetrieverException(exceptionLocalizer.format(
                    "connection-refused", url.toString()), e);
        }
View Full Code Here

Examples of de.innovationgate.eclipse.utils.DefaultHttpClient.executeMethod()

 
   public TemporaryFile downloadWGA(IProgressMonitor monitor, String url) throws IllegalStateException, IOException, URISyntaxException {
        monitor.setTaskName("Downloading OpenWGA from '" + url + "'");                    
        HttpClient client = new DefaultHttpClient((IProxyService)_proxyServiceTracker.getService(), new URI(url));
        GetMethod get = new GetMethod(url);
    int result = client.executeMethod(get);
    if (result == HttpURLConnection.HTTP_OK) {
      long size = get.getResponseContentLength();               
            TemporaryFile temp = new TemporaryFile("wga.war", new ProgressMonitorInputStream(monitor, "Downloading OpenWGA ", size, get.getResponseBodyAsStream()), getStateLocation().toFile());
      return temp;
    } else {
View Full Code Here

Examples of org.apache.cloudstack.network.opendaylight.api.NeutronRestApi.executeMethod()

                    nameValuePairs.add(new NameValuePair(e.getKey(), e.getValue()));
                }
                getMethod.setQueryString(nameValuePairs.toArray(new NameValuePair[0]));
            }

            neutronRestApi.executeMethod(getMethod);

            if (getMethod.getStatusCode() != HttpStatus.SC_OK) {
                String errorMessage = responseToErrorMessage(getMethod);
                getMethod.releaseConnection();
                s_logger.error("Failed to retrieve object : " + errorMessage);
View Full Code Here

Examples of org.apache.commons.httpclient.HttpClient.executeMethod()

    HttpClient httpClient = new HttpClient();
        PostMethod httpPostMethod = new PostMethod(u.toExternalForm());
        httpPostMethod.setRequestHeader("SOAPAction", "\"" + soapAction + "\"");
        httpPostMethod.setRequestHeader("Content-Type", "text/xml");
        httpPostMethod.setRequestEntity(new StringRequestEntity(request));
        httpClient.executeMethod(httpPostMethod);
        String result=httpPostMethod.getResponseBodyAsString();
   
    return(result);
  }
 
View Full Code Here

Examples of org.apache.commons.httpclient.HttpClient.executeMethod()

 
   public TemporaryFile downloadWGA(IProgressMonitor monitor, String url) throws IllegalStateException, IOException, URISyntaxException {
        monitor.setTaskName("Downloading OpenWGA from '" + url + "'");                    
        HttpClient client = new DefaultHttpClient((IProxyService)_proxyServiceTracker.getService(), new URI(url));
        GetMethod get = new GetMethod(url);
    int result = client.executeMethod(get);
    if (result == HttpURLConnection.HTTP_OK) {
      long size = get.getResponseContentLength();               
            TemporaryFile temp = new TemporaryFile("wga.war", new ProgressMonitorInputStream(monitor, "Downloading OpenWGA ", size, get.getResponseBodyAsStream()), getStateLocation().toFile());
      return temp;
    } else {
View Full Code Here

Examples of org.apache.commons.httpclient.HttpClient.executeMethod()

        httpClient.getParams().setParameter("http.protocol.expect-continue", true);

        PostMethod meth = new PostMethod("http://localhost:" + server.getLocalPort() + "/test");
        meth.setRequestBody("OK");

        httpClient.executeMethod(meth);
       
        Assert.assertEquals(200, meth.getStatusCode());
        Assert.assertEquals("OK", meth.getResponseBodyAsString());
       
        meth.releaseConnection();
View Full Code Here

Examples of org.apache.commons.httpclient.HttpClient.executeMethod()

    {
        // Use the HEAD method to probe the file.
        method = new HeadMethod();
        setupMethod(method);
        final HttpClient client = fileSystem.getClient();
        final int status = client.executeMethod(method);
        method.releaseConnection();
        if (status == HttpURLConnection.HTTP_OK)
        {
            return FileType.FILE;
        }
View Full Code Here

Examples of org.apache.commons.httpclient.HttpClient.executeMethod()

                final UsernamePasswordCredentials creds =
                    new UsernamePasswordCredentials(username, password);
                client.getState().setCredentials(null, hostname, creds);
            }

            client.executeMethod(new HeadMethod());
        }
        catch (final Exception exc)
        {
            throw new FileSystemException("vfs.provider.http/connect.error", new Object[]{hostname}, exc);
        }
View Full Code Here

Examples of org.apache.commons.httpclient.HttpClient.executeMethod()

    try
    {
      HttpClient client = new HttpClient();
      setAuthentication(client, method);
      statusCode = client.executeMethod(method);

      response = IOUtils.toString(method.getResponseBodyAsStream(),
          method.getResponseCharSet());

      method.releaseConnection();
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.