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

com.jd.httpservice.agent.RequestUtils Maven / Gradle / Ivy

There is a newer version: 2.1.4.RELEASE
Show newest version
package com.jd.httpservice.agent;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;

import com.jd.httpservice.NamedParam;
import com.jd.httpservice.NamedParamMap;

public abstract class RequestUtils {
	
	@SuppressWarnings("unchecked")
	public static List createQueryParameters(NamedParamMap queryParams) {
		if (queryParams == null || queryParams.isEmpty()) {
			return Collections.EMPTY_LIST;
		}
		List params = new ArrayList();
		NamedParam[] paramValues = queryParams.getParams();
		for (NamedParam param : paramValues) {
			params.add(new BasicNameValuePair(param.getName(), param.getValue()));
		}
		return params;
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy