Package com.ning.http.client

Examples of com.ning.http.client.AsyncCompletionHandler


    @Autowired
    private MessageService messageService;

    private void doGet(final Nabaztag nabaztag, String url) throws IOException {
        asyncHttpClient.prepareGet(url).execute(new AsyncCompletionHandler() {
            @Override
            public Object onCompleted(Response response) throws Exception {
                String responseBody = response.getResponseBody();
                logger.debug("responseBody {}",  responseBody);
                if(!responseBody.isEmpty())
View Full Code Here


            doPost( nabaztag, urlToCall, parameters);
        }
    }

    private void doPost(final Nabaztag nabaztag, String urlToCall, String parameters) throws IOException {
        asyncHttpClient.preparePost(urlToCall).setBody(parameters).execute(new AsyncCompletionHandler() {
            @Override
            public Object onCompleted(Response response) throws Exception {
                String responseBody = response.getResponseBody();
                logger.debug("responseBody {}",  responseBody);
                if(!responseBody.isEmpty())
View Full Code Here

        messageService.sendMessage(nabaztag.getMacAddress(), command.toString());
    }

    private void initHoroscopeOfDay(final Nabaztag nabaztag, final int dayOfYear, final String tzID, final String sign) throws IOException {
        asyncHttpClient.prepareGet(BASE_URL_FR).execute(new AsyncCompletionHandler() {
            @Override
            public Object onCompleted(Response response) throws Exception {
                DocumentBuilder builder = builderLocal.get();
                String responseBody = response.getResponseBody("ISO-8859-1");
                StringReader reader = new StringReader(responseBody);
View Full Code Here

TOP

Related Classes of com.ning.http.client.AsyncCompletionHandler

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.