All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.nycjv321.http.HttpQueryParameterBuilder Maven / Gradle / Ivy

Go to download

A simple wrapper of Apache's Http Client Library that tries to make interacting with HTTP Easy

The newest version!
package com.nycjv321.http;

import java.util.Iterator;
import java.util.Map;
import java.util.Set;

/**
 * Created by fedora on 11/21/15.
 */
public class HttpQueryParameterBuilder {

    public static String build(Map parameters) {
            if (parameters.isEmpty()) {
                return "";
            }
            Set strings = parameters.keySet();
            String parametersString = "?";
            for (Iterator iterator = strings.iterator(); iterator.hasNext(); ) {
                String string = iterator.next();
                parametersString = parametersString + string + "=" + parameters.get(string);
                if (iterator.hasNext()) {
                    parametersString = parametersString + "&";
                }
            }
            return parametersString;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy