Package org.apache.http.client.methods

Examples of org.apache.http.client.methods.HttpDelete


      throws ManifoldCFException, ServiceInterruption
  {
    try
    {
      String idField = java.net.URLEncoder.encode(documentURI,"utf-8");
      HttpDelete method = new HttpDelete(config.getServerLocation() +
          "/" + config.getIndexName() + "/" + config.getIndexType()
          + "/" + idField);
      call(method);
      if ("true".equals(checkJson(jsonStatus)))
        return;
View Full Code Here


  */
  public String performAPIDeleteOperation(String apiURL, int expectedResponse)
    throws Exception
  {
    DefaultHttpClient client = new DefaultHttpClient();
    HttpDelete method = new HttpDelete(apiURL);
    try
    {
      HttpResponse response = client.execute(method);
      int responseCode = response.getStatusLine().getStatusCode();
      String responseString = convertToString(response);
      if (responseCode != expectedResponse)
        throw new Exception("API http error; expected "+Integer.toString(expectedResponse)+", saw "+Integer.toString(responseCode)+": "+responseString);
      // We presume that the data is utf-8, since that's what the API uses throughout.
      return responseString;
    }
    finally
    {
      method.abort();
    }
  }
View Full Code Here

    public static Request Trace(final String uri) {
        return new Request(new HttpTrace(uri));
    }

    public static Request Delete(final URI uri) {
        return new Request(new HttpDelete(uri));
    }
View Full Code Here

    public static Request Delete(final URI uri) {
        return new Request(new HttpDelete(uri));
    }

    public static Request Delete(final String uri) {
        return new Request(new HttpDelete(uri));
    }
View Full Code Here

    @SuppressWarnings("unused")
    synchronized private void doUnRegister(String service) {
        String url = registryURL;
        try {
            HttpDelete method = new HttpDelete(url);
            method.addHeader("service", service);
            ResponseHandler<String> handler = new BasicResponseHandler();
            String responseBody = httpClient.execute(method, handler);
            LOG.debug("DELETE to " + url + " got a " + responseBody);
        } catch (Exception e) {
            LOG.debug("DELETE to " + url + " failed with: " + e);
View Full Code Here

            HttpResponse response = httpclient.execute(post);
            assertEquals(200, response.getStatusLine().getStatusCode());
            assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><Customer><id>124</id><name>Jack</name></Customer>",
                         EntityUtils.toString(response.getEntity()));
           
            HttpDelete del = new HttpDelete("http://localhost:" + PORT0 + "/CxfRsRouterTest/route/customerservice/customers/124/");
            httpclient.execute(del);
        } finally {
            httpclient.getConnectionManager().shutdown();
        }
View Full Code Here

            HttpResponse response = httpclient.execute(post);
            assertEquals(201, response.getStatusLine().getStatusCode());
            assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><Customer><id>124</id><name>Jack</name></Customer>",
                         EntityUtils.toString(response.getEntity()));

            HttpDelete del = new HttpDelete("http://localhost:" + PORT0 + "/CxfRsRouterTest/route/customerservice/customers/124/");
            httpclient.execute(del);
        } finally {
            httpclient.getConnectionManager().shutdown();
        }
    }
View Full Code Here

            HttpResponse response = httpclient.execute(post);
            assertEquals(200, response.getStatusLine().getStatusCode());
            assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><Customer><id>124</id><name>Jack</name></Customer>",
                         EntityUtils.toString(response.getEntity()));
           
            HttpDelete del = new HttpDelete("http://localhost:" + PORT0 + "/CxfRsRouterTest/route/customerservice/customers/124/");
            httpclient.execute(del);
        } finally {
            httpclient.getConnectionManager().shutdown();
        }
View Full Code Here

            HttpResponse response = httpclient.execute(post);
            assertEquals(201, response.getStatusLine().getStatusCode());
            assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><Customer><id>124</id><name>Jack</name></Customer>",
                         EntityUtils.toString(response.getEntity()));

            HttpDelete del = new HttpDelete("http://localhost:" + PORT0 + "/CxfRsRouterTest/route/customerservice/customers/124/");
            httpclient.execute(del);
        } finally {
            httpclient.getConnectionManager().shutdown();
        }
    }
View Full Code Here

    public static HttpAsyncRequestProducer createHead(final String requestURI) {
        return create(new HttpGet(URI.create(requestURI)));
    }

    public static HttpAsyncRequestProducer createDelete(final URI requestURI) {
        return create(new HttpDelete(requestURI));
    }
View Full Code Here

TOP

Related Classes of org.apache.http.client.methods.HttpDelete

Copyright © 2018 www.massapicom. 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.