Package org.apache.http.impl.client

Examples of org.apache.http.impl.client.BasicResponseHandler


        this.serverBootstrap.registerHandler("*", createGzipEncodingRequestHandler(entityText));

        final HttpHost target = start();

        final HttpGet request = new HttpGet("/some-resource");
        final String response = this.httpclient.execute(target, request, new BasicResponseHandler());
        Assert.assertEquals("The entity text is correctly transported", entityText, response);
    }
View Full Code Here


        this.serverBootstrap.registerHandler("*", createDeflateEncodingRequestHandler(entityText, false));

        final HttpHost target = start();

        final HttpGet request = new HttpGet("/some-resource");
        final String response = this.httpclient.execute(target, request, new BasicResponseHandler());
        Assert.assertEquals("The entity text is correctly transported", entityText, response);
    }
View Full Code Here

      final int statusCode = response.getStatusLine().getStatusCode();
      if (statusCode != 200) {
        LOG.debug("Nexus Status Check: Returned status: " + statusCode);
        return false;
      }
      final String responseAsString = new BasicResponseHandler().handleResponse(response);
      if (responseAsString == null || !responseAsString.contains("<state>STARTED</state>")) {
        LOG.debug("Nexus Status Check: Invalid system state. Status: " + responseAsString);
        return false;
      }
    }
View Full Code Here

        nvps.add(new BasicNameValuePair("password", password));

        HttpPost method = new HttpPost(builder.toURI());
        method.setEntity(new UrlEncodedFormEntity(nvps, Consts.UTF_8));

        ResponseHandler<String> handler = new BasicResponseHandler();
        getDc().getHttpClient().execute(method, handler);
    }
View Full Code Here

        builder.add(getAlias());
        builder.add("logout");

        HttpPost method = new HttpPost(builder.toURI());

        ResponseHandler<String> handler = new BasicResponseHandler();
        getDc().getHttpClient().execute(method, handler);
    }
View Full Code Here

        builder.add(getAlias());

        HttpPost method = new HttpPost(builder.toURI());
        method.setEntity(uefe);

        ResponseHandler<String> handler = new BasicResponseHandler();
        String response = getDc().getHttpClient().execute(method, handler);

        return new Gson().fromJson(response, NodeMessage.class);
    }
View Full Code Here

        builder.add(getAlias());
        builder.add(id);

        HttpGet method = new HttpGet(builder.toURI());

        ResponseHandler<String> handler = new BasicResponseHandler();
        String response = getDc().getHttpClient().execute(method, handler);

        return new Gson().fromJson(response, NodeMessage.class);
    }
View Full Code Here

        builder.add(id);

        HttpPut method = new HttpPut(builder.toURI());
        method.setEntity(uefe);

        ResponseHandler<String> handler = new BasicResponseHandler();
        String response = getDc().getHttpClient().execute(method, handler);

        return new Gson().fromJson(response, NodeMessage.class);
    }
View Full Code Here

        builder.add(getAlias());
        builder.add(id);

        HttpDelete method = new HttpDelete(builder.toURI());

        ResponseHandler<String> handler = new BasicResponseHandler();
        String response = getDc().getHttpClient().execute(method, handler);

        return Boolean.valueOf(response);
    }
View Full Code Here

        builder.add(getAlias());
        builder.addQuery(params);

        HttpGet method = new HttpGet(builder.toURI());

        ResponseHandler<String> handler = new BasicResponseHandler();
        String response = getDc().getHttpClient().execute(method, handler);

        return new Gson().fromJson(response,
                new TypeToken<List<NodeMessage>>() {
                }.getType());
View Full Code Here

TOP

Related Classes of org.apache.http.impl.client.BasicResponseHandler

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.