Package io.higgs.http.client

Examples of io.higgs.http.client.Request


     * @return The balance on the account being used to make API calls
     */
    public FutureData<Balance> balance() {
        FutureData<Balance> future = new FutureData<Balance>();
        URI uri = newParams().forURL(config.newAPIEndpointURI(BALANCE));
        Request request = config.http().GET(uri, new PageReader(newRequestCallback(future, new Balance(), config)));
        applyConfig(request).execute();
        return future;
    }
View Full Code Here


        final Dpu dpu = new Dpu();
        //
        final FutureResponse<Stream> response = new FutureResponse<Stream>() {
            public void apply(Stream stream) {
                URI uri = newParams().put("hash", stream.hash()).forURL(config.newAPIEndpointURI(DPU));
                Request request = config.http().GET(uri, new PageReader(newRequestCallback(future, dpu, config)));
                applyConfig(request).execute();
            }
        };
        unwrapFuture(streamFuture, future, dpu, response);
        return future;
View Full Code Here

            case DAY:
            default:
                period = "day";
        }
        URI uri = newParams().put("period", period).forURL(config.newAPIEndpointURI(USAGE));
        Request request = config.http().GET(uri, new PageReader(newRequestCallback(future, new Usage(), config)));
        applyConfig(request).execute();
        return future;
    }
View Full Code Here

        }
        if (perPage > 0) {
            b.put("per_page", perPage);
        }
        URI uri = b.forURL(config.newAPIEndpointURI(GET));
        Request request = config.http().
                GET(uri, new PageReader(newRequestCallback(future, new ManagedSourceList(), config)));
        applyConfig(request).execute();
        return future;
    }
View Full Code Here

     * @return the managed source for the ID provided
     */
    public FutureData<ManagedSource> get(String id) {
        FutureData<ManagedSource> future = new FutureData<>();
        URI uri = newParams().put("id", id).forURL(config.newAPIEndpointURI(GET));
        Request request = config.http().
                GET(uri, new PageReader(newRequestCallback(future, new ManagedSource(), config)));
        applyConfig(request).execute();
        return future;
    }
View Full Code Here

        }
        if (perPage > 0) {
            b.put("per_page", perPage);
        }
        URI uri = b.forURL(config.newAPIEndpointURI(LOG));
        Request request = config.http().
                GET(uri, new PageReader(newRequestCallback(future, new ManagedSourceLog(), config)));
        applyConfig(request).execute();
        return future;
    }
View Full Code Here

     * @return The balance on the account being used to make API calls
     */
    public FutureData<Balance> balance() {
        FutureData<Balance> future = new FutureData<Balance>();
        URI uri = newParams().forURL(config.newAPIEndpointURI(BALANCE));
        Request request = config.http().GET(uri, new PageReader(newRequestCallback(future, new Balance(), config)));
        performRequest(future, request);
        return future;
    }
View Full Code Here

        final Dpu dpu = new Dpu();
        //
        final FutureResponse<Stream> response = new FutureResponse<Stream>() {
            public void apply(Stream stream) {
                URI uri = newParams().put("hash", stream.hash()).forURL(config.newAPIEndpointURI(DPU));
                Request request = config.http().GET(uri, new PageReader(newRequestCallback(future, dpu, config)));
                performRequest(future, request);
            }
        };
        unwrapFuture(streamFuture, future, dpu, response);
        return future;
View Full Code Here

            case DAY:
            default:
                period = "day";
        }
        URI uri = newParams().put("period", period).forURL(config.newAPIEndpointURI(USAGE));
        Request request = config.http().GET(uri, new PageReader(newRequestCallback(future, new Usage(), config)));
        performRequest(future, request);
        return future;
    }
View Full Code Here

     * @return this
     */
    public FutureData<DataSiftResult> get() {
        final FutureData<DataSiftResult> future = new FutureData<>();
        URI uri = newParams().forURL(config.newAPIEndpointURI(GET));
        Request request = config.http()
                .GET(uri, new PageReader(newRequestCallback(future, new BaseDataSiftResult(), config)));
        performRequest(future, request);
        return future;
    }
View Full Code Here

TOP

Related Classes of io.higgs.http.client.Request

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.