Java Code Examples for org.xutils.http.RequestParams#addParameter()

The following examples show how to use org.xutils.http.RequestParams#addParameter() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: XUtil3HttpUtil.java    From AndroidStudyDemo with GNU General Public License v2.0 5 votes vote down vote up
/**
 * 发送post请求
 * @param <T>
 */
public static <T> Cancelable Post(String url,Map<String,Object> map,CommonCallback<T> callback){
	RequestParams params=new RequestParams(url);
	if(null!=map){
		for(Map.Entry<String, Object> entry : map.entrySet()){
			params.addParameter(entry.getKey(), entry.getValue());
		}
	}
	Cancelable cancelable = x.http().get(params, callback);
	return cancelable;
}
 
Example 2
Source File: XUtil3HttpUtil.java    From AndroidStudyDemo with GNU General Public License v2.0 5 votes vote down vote up
/**
 * 上传文件
 * @param <T>
 */
public static <T> Cancelable UpLoadFile(String url,Map<String,Object> map,CommonCallback<T> callback){
	RequestParams params=new RequestParams(url);
	if(null!=map){
		for(Map.Entry<String, Object> entry : map.entrySet()){
			params.addParameter(entry.getKey(), entry.getValue());
		}
	}
	params.setMultipart(true);
	Cancelable cancelable = x.http().get(params, callback);
	return cancelable;
}