Package org.apache.http.client.methods

Examples of org.apache.http.client.methods.HttpDelete.addHeader()


            .accept("text/plain").post(null, String.class);
        assertEquals("ok", r);
       
        HttpClient httpclient = new DefaultHttpClient();
        HttpDelete httpdelete = new HttpDelete("http://localhost:" + PORT + "/untest/delete");
        httpdelete.addHeader("Origin", "http://localhost:" + PORT);

        HttpResponse response = httpclient.execute(httpdelete);
        assertEquals(200, response.getStatusLine().getStatusCode());
        assertAllowCredentials(response, false);
        assertOriginResponse(true, null, true, response);
View Full Code Here


            .accept("text/plain").post(null, String.class);
        assertEquals("ok", r);
       
        HttpClient httpclient = new DefaultHttpClient();
        HttpDelete httpdelete = new HttpDelete("http://localhost:" + PORT + "/untest/delete");
        httpdelete.addHeader("Origin", "http://localhost:" + PORT);

        HttpResponse response = httpclient.execute(httpdelete);
        assertEquals(200, response.getStatusLine().getStatusCode());
        assertAllowCredentials(response, false);
        assertOriginResponse(true, null, true, response);
View Full Code Here

            .accept("text/plain").post(null, String.class);
        assertEquals("ok", r);
       
        HttpClient httpclient = new DefaultHttpClient();
        HttpDelete httpdelete = new HttpDelete("http://localhost:" + PORT + "/untest/delete");
        httpdelete.addHeader("Origin", "http://localhost:" + PORT);

        HttpResponse response = httpclient.execute(httpdelete);
        assertEquals(200, response.getStatusLine().getStatusCode());
        assertAllowCredentials(response, false);
        assertOriginResponse(true, null, true, response);
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

    try
    {
      HttpClient httpclient = new DefaultHttpClient();
      HttpDelete httpdelete = new HttpDelete(Parse.getParseAPIUrlClasses() + mClassName + "/"
          + getObjectId());
      httpdelete.addHeader("X-Parse-Application-Id", Parse.getApplicationId());
      httpdelete.addHeader("X-Parse-REST-API-Key", Parse.getRestAPIKey());

      HttpResponse httpresponse = httpclient.execute(httpdelete);
      HttpEntity entity = httpresponse.getEntity();
View Full Code Here

    {
      HttpClient httpclient = new DefaultHttpClient();
      HttpDelete httpdelete = new HttpDelete(Parse.getParseAPIUrlClasses() + mClassName + "/"
          + getObjectId());
      httpdelete.addHeader("X-Parse-Application-Id", Parse.getApplicationId());
      httpdelete.addHeader("X-Parse-REST-API-Key", Parse.getRestAPIKey());

      HttpResponse httpresponse = httpclient.execute(httpdelete);
      HttpEntity entity = httpresponse.getEntity();

      ParseResponse response = new ParseResponse(httpresponse);
View Full Code Here

            .accept("text/plain").post(null, String.class);
        assertEquals("ok", r);
       
        HttpClient httpclient = new DefaultHttpClient();
        HttpDelete httpdelete = new HttpDelete("http://localhost:" + PORT + "/untest/delete");
        httpdelete.addHeader("Origin", "http://localhost:" + PORT);

        HttpResponse response = httpclient.execute(httpdelete);
        assertEquals(200, response.getStatusLine().getStatusCode());
        assertAllowCredentials(response, false);
        assertOriginResponse(true, null, true, response);
View Full Code Here

            .accept("text/plain").post(null, String.class);
        assertEquals("ok", r);
       
        HttpClient httpclient = new DefaultHttpClient();
        HttpDelete httpdelete = new HttpDelete("http://localhost:" + PORT + "/untest/delete");
        httpdelete.addHeader("Origin", "http://localhost:" + PORT);

        HttpResponse response = httpclient.execute(httpdelete);
        assertEquals(200, response.getStatusLine().getStatusCode());
        assertAllowCredentials(response, false);
        assertOriginResponse(true, null, true, response);
View Full Code Here

            .accept("text/plain").post(null, String.class);
        assertEquals("ok", r);
       
        HttpClient httpclient = HttpClientBuilder.create().build();
        HttpDelete httpdelete = new HttpDelete("http://localhost:" + PORT + "/untest/delete");
        httpdelete.addHeader("Origin", "http://localhost:" + PORT);

        HttpResponse response = httpclient.execute(httpdelete);
        assertEquals(200, response.getStatusLine().getStatusCode());
        assertAllowCredentials(response, false);
        assertOriginResponse(true, null, true, response);
View Full Code Here

    }
   
    @Test
    public void testDeleteVipCustomer() throws Exception {
        HttpDelete delete = new HttpDelete("http://localhost:" + PORT_PATH + "/rest/customerservice/customers/vip/gold/123");
        delete.addHeader("Accept", "text/xml");
        HttpResponse response = httpclient.execute(delete);
        assertEquals(200, response.getStatusLine().getStatusCode());
    }
   
    @Test
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.