Package org.apache.http.client.methods

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


      if (request.getMethod().equals(HttpMethod.HEAD)) {
         apacheRequest = new HttpHead(request.getEndpoint());
      } else if (request.getMethod().equals(HttpMethod.GET)) {
         apacheRequest = new HttpGet(request.getEndpoint());
      } else if (request.getMethod().equals(HttpMethod.DELETE)) {
         apacheRequest = new HttpDelete(request.getEndpoint());
      } else if (request.getMethod().equals(HttpMethod.PUT)) {
         apacheRequest = new HttpPut(request.getEndpoint());
         apacheRequest.getParams().setBooleanParameter(CoreProtocolPNames.USE_EXPECT_CONTINUE, true);
      } else if (request.getMethod().equals(HttpMethod.POST)) {
         apacheRequest = new HttpPost(request.getEndpoint());
View Full Code Here


   */
  @Override
  protected LowLevelHttpRequest buildRequest(String method, String url) throws IOException {
    HttpRequestBase requestBase;
    if (method.equals(HttpMethods.DELETE)) {
      requestBase = new HttpDelete(url);
    } else if (method.equals(HttpMethods.GET)) {
      requestBase = new HttpGet(url);
    } else if (method.equals(HttpMethods.HEAD)) {
      requestBase = new HttpHead(url);
    } else if (method.equals(HttpMethods.POST)) {
View Full Code Here

                    logger.trace("payload: [{}]", IOUtils.toString(put.getEntity().getContent()));
                }
            }
            req = put;
        } else if (method.equals("DELETE")) {
            req = new HttpDelete(url);
        } else {
            req = new HttpGet(url);
        }

        req.setHeader("Accept", MIME_TYPE);
View Full Code Here

        return get(path, new HashMap<String, String>());
    }

    public void delete(String path, Map<String, String> params) throws HTTPError {
        URI uri = buildUri(path, params);
        HttpDelete request = new HttpDelete(uri);
        addHeaders(request);
        op(request);
    }
View Full Code Here

   */
  @Override
  public void delete ( URL url, Map<String, String> newHeaders, Map<String, String> responseHeaders )
      throws Exception
  {
    HttpDelete delete = new HttpDelete(url.toURI());
    setupMethod(delete, newHeaders);
    HttpResponse response = execute(delete);
    if (responseHeaders != null && response.getAllHeaders().length != 0)
    {
      for (Header header : response.getAllHeaders())
View Full Code Here

  /**
   * Deletes the given key
   */
  public EtcdResult delete(String key) throws EtcdClientException {
    URI uri = buildKeyUri("v2/keys", key, "");
    HttpDelete request = new HttpDelete(uri);

    return syncExecute(request, new int[] { 200, 404 });
  }
View Full Code Here

  /**
   * Delete a directory
   */
  public EtcdResult deleteDirectory(String key) throws EtcdClientException {
    URI uri = buildKeyUri("v2/keys", key, "?dir=true");
    HttpDelete request = new HttpDelete(uri);
    return syncExecute(request, new int[] { 202 });
  }
View Full Code Here

    {
        String uri = buildRequestWithKey( request );

        log.debug( "get request to: {}", uri );

        HttpDelete httpDelete = new HttpDelete( uri );

        try
        {
            HttpResponse httpResponse = this.httpClient.execute( httpDelete );
View Full Code Here

            } else if (method.equals(TRACE)) {
                httpRequest = new HttpTrace(uri);
            } else if (method.equals(OPTIONS)) {
                httpRequest = new HttpOptions(uri);
            } else if (method.equals(DELETE)) {
                httpRequest = new HttpDelete(uri);
            } else if (method.equals(GET)) {
                httpRequest = new HttpGet(uri);
            } else {
                throw new IllegalArgumentException("Unexpected method: "+method);
            }
View Full Code Here

    String urlString = sp.resolveMustExist(currentStream,url).getStringValue();
   
    try
    {
      HttpClient client = sp.getHttpClient();
      HttpDelete method = new HttpDelete(urlString);
      try
      {
        HttpResponse httpResponse = client.execute(method);
        int resultCode = httpResponse.getStatusLine().getStatusCode();
        String resultJSON = sp.convertToString(httpResponse);
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.