Package org.apache.http.client.utils

Examples of org.apache.http.client.utils.URIBuilder.addParameter()


    }

    private String getUploadUrl(URL url, Method method, Map<String, String> params) throws URISyntaxException, IOException {
        URIBuilder builder = new URIBuilder(url.toURI());
        for (Map.Entry<String, String> entry : params.entrySet()) {
            builder.addParameter(entry.getKey(), entry.getValue());
        }
        try (CloseableHttpClient client = HttpClients.createDefault()) {
            HttpUriRequest request;
            switch (method) {
                case GET:
View Full Code Here


    private void doTest(HttpClient client, URI uri, Set<Header> headers, Map<String, String> params, String expected) throws Exception {
        URIBuilder builder = new URIBuilder(uri);
        if (params != null) {
            for (Map.Entry<String, String> entry : params.entrySet()) {
                builder.addParameter(entry.getKey(), entry.getValue());
            }
        }
        HttpGet get = new HttpGet(builder.build());
        if (headers != null) {
            for (Header h : headers) {
View Full Code Here

                .addParameter("uniq", String.valueOf(new DateTime().getMillis()))
                .addParameter("hideLegend", legendState == LegendState.HIDE ? "true" : "false")
                .addParameter("hideAxes", axesState == AxesState.HIDE ? "true" : "false");
       
        if (warnThreshold != null) {
            uriBuilder.addParameter("target", String.format(THRESHOLD_TARGET, warnThreshold.toString(), "yellow", "warn level"));
        }
       
        if (errorThreshold != null) {
            uriBuilder.addParameter("target", String.format(THRESHOLD_TARGET, errorThreshold.toString(), "red", "error level"));
        }
View Full Code Here

        if (warnThreshold != null) {
            uriBuilder.addParameter("target", String.format(THRESHOLD_TARGET, warnThreshold.toString(), "yellow", "warn level"));
        }
       
        if (errorThreshold != null) {
            uriBuilder.addParameter("target", String.format(THRESHOLD_TARGET, errorThreshold.toString(), "red", "error level"));
        }
       
        HttpGet get = new HttpGet(uriBuilder.build());
       
        try {
View Full Code Here

        }

        URI sruUri;
        try {
            URIBuilder builder = new URIBuilder(url);
            builder.addParameter("operation", "searchRetrieve");
            builder.addParameter("version", "1.1");
            builder.addParameter("recordSchema", "info:srw/schema/1/marcxml-v1.1");
            builder.addParameter("query", query.toString());
            builder.addParameter("maximumRecords", String.valueOf(limit));
            builder.addParameter("startRecord", String.valueOf(start+1));
View Full Code Here

        URI sruUri;
        try {
            URIBuilder builder = new URIBuilder(url);
            builder.addParameter("operation", "searchRetrieve");
            builder.addParameter("version", "1.1");
            builder.addParameter("recordSchema", "info:srw/schema/1/marcxml-v1.1");
            builder.addParameter("query", query.toString());
            builder.addParameter("maximumRecords", String.valueOf(limit));
            builder.addParameter("startRecord", String.valueOf(start+1));
            sruUri = builder.build();
View Full Code Here

        URI sruUri;
        try {
            URIBuilder builder = new URIBuilder(url);
            builder.addParameter("operation", "searchRetrieve");
            builder.addParameter("version", "1.1");
            builder.addParameter("recordSchema", "info:srw/schema/1/marcxml-v1.1");
            builder.addParameter("query", query.toString());
            builder.addParameter("maximumRecords", String.valueOf(limit));
            builder.addParameter("startRecord", String.valueOf(start+1));
            sruUri = builder.build();
        } catch (URISyntaxException e) {
View Full Code Here

        try {
            URIBuilder builder = new URIBuilder(url);
            builder.addParameter("operation", "searchRetrieve");
            builder.addParameter("version", "1.1");
            builder.addParameter("recordSchema", "info:srw/schema/1/marcxml-v1.1");
            builder.addParameter("query", query.toString());
            builder.addParameter("maximumRecords", String.valueOf(limit));
            builder.addParameter("startRecord", String.valueOf(start+1));
            sruUri = builder.build();
        } catch (URISyntaxException e) {
            log.error("SRU query failed: ", e);
View Full Code Here

            URIBuilder builder = new URIBuilder(url);
            builder.addParameter("operation", "searchRetrieve");
            builder.addParameter("version", "1.1");
            builder.addParameter("recordSchema", "info:srw/schema/1/marcxml-v1.1");
            builder.addParameter("query", query.toString());
            builder.addParameter("maximumRecords", String.valueOf(limit));
            builder.addParameter("startRecord", String.valueOf(start+1));
            sruUri = builder.build();
        } catch (URISyntaxException e) {
            log.error("SRU query failed: ", e);
            return new Choices(true);
View Full Code Here

            builder.addParameter("operation", "searchRetrieve");
            builder.addParameter("version", "1.1");
            builder.addParameter("recordSchema", "info:srw/schema/1/marcxml-v1.1");
            builder.addParameter("query", query.toString());
            builder.addParameter("maximumRecords", String.valueOf(limit));
            builder.addParameter("startRecord", String.valueOf(start+1));
            sruUri = builder.build();
        } catch (URISyntaxException e) {
            log.error("SRU query failed: ", e);
            return new Choices(true);
        }
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.