本文整理汇总了Java中org.xutils.http.RequestParams.addQueryStringParameter方法的典型用法代码示例。如果您正苦于以下问题:Java RequestParams.addQueryStringParameter方法的具体用法?Java RequestParams.addQueryStringParameter怎么用?Java RequestParams.addQueryStringParameter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.xutils.http.RequestParams
的用法示例。
在下文中一共展示了RequestParams.addQueryStringParameter方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: get
import org.xutils.http.RequestParams; //导入方法依赖的package包/类
/**
* 异步get请求
*
* @param url
* @param maps
* @param callBack
*/
public void get(String url, Map<String, String> maps, final XCallBack callBack) {
RequestParams params = new RequestParams(url);
if (maps != null && !maps.isEmpty()) {
for (Map.Entry<String, String> entry : maps.entrySet()) {
params.addQueryStringParameter(entry.getKey(), entry.getValue());
}
}
Log.e("url",params.toString());
x.http().get(params, new Callback.CommonCallback<String>() {
@Override
public void onSuccess(String result) {
onSuccessResponse(result, callBack);
}
@Override
public void onError(Throwable ex, boolean isOnCallback) {
ex.printStackTrace();
onFailResponse(ex.toString(), callBack);
}
@Override
public void onCancelled(CancelledException cex) {
}
@Override
public void onFinished() {
}
});
}
示例2: getSongList
import org.xutils.http.RequestParams; //导入方法依赖的package包/类
/**
* 获取排行榜数据
* @param callback
*/
public static void getSongList(Callback.CommonCallback<String> callback) {
RequestParams params = new RequestParams(Const.SongUrl) ;
params.addQueryStringParameter("groupcode" , "365905/365911/365942/430570");
params.addQueryStringParameter("pageno" , "1");
params.addQueryStringParameter("ua" , "Android_sst");
params.addQueryStringParameter("version" , "4.3100");
x.http().get(params , callback) ;
}
示例3: initDa
import org.xutils.http.RequestParams; //导入方法依赖的package包/类
private void initDa() {
RequestParams p = new RequestParams("http://api.ktfootball.com/shool_user_tests/school_football_skill_test_home_page_tongji");
p.addQueryStringParameter("authenticity_token","K9MpaPMdj0jij2m149sL1a7TcYrWXmg5GLrAJDCNBx8");
p.addQueryStringParameter("club_id","89");
x.http().get(p, new Callback.CommonCallback<String>() {
@Override
public void onSuccess(String result) {
TestIndexData testIndexData = new Gson().fromJson(result.toString(),new TypeToken<TestIndexData>(){}.getType());
mAll_people.setText(testIndexData.getUsers_count());
mAll_pingjun.setText(testIndexData.getAverage_scores());
}
@Override
public void onError(Throwable ex, boolean isOnCallback) {
}
@Override
public void onCancelled(CancelledException cex) {
}
@Override
public void onFinished() {
}
});
}
示例4: initData2
import org.xutils.http.RequestParams; //导入方法依赖的package包/类
private void initData2() {
RequestParams p = new RequestParams("http://api.ktfootball.com/shool_user_tests/school_football_skill_test_ranking");
p.addQueryStringParameter("authenticity_token","K9MpaPMdj0jij2m149sL1a7TcYrWXmg5GLrAJDCNBx8");
p.addQueryStringParameter("club_id","89");
x.http().get(p, new Callback.CommonCallback<String>() {
@Override
public void onSuccess(String result) {
TestPaiMingBean testPaiMingBean = new Gson().fromJson(result.toString(),new TypeToken<TestPaiMingBean>(){}.getType());
System.out.println("----123"+testPaiMingBean.toString());
/*mAll_people.setText(testIndexData.getUsers_count());
mAll_pingjun.setText(testIndexData.getAverage_scores());*/
}
@Override
public void onError(Throwable ex, boolean isOnCallback) {
}
@Override
public void onCancelled(CancelledException cex) {
}
@Override
public void onFinished() {
}
});
}
示例5: initData
import org.xutils.http.RequestParams; //导入方法依赖的package包/类
public void initData(){
RequestParams p = new RequestParams("http://api.ktfootball.com/school_big_class_rooms/home_tongji");
p.addQueryStringParameter("authenticity_token","K9MpaPMdj0jij2m149sL1a7TcYrWXmg5GLrAJDCNBx8");
p.addQueryStringParameter("club_id","89");
x.http().get(p, new Callback.CommonCallback<String>() {
@Override
public void onSuccess(String result) {
indexData = new Gson().fromJson(result.toString(),new TypeToken<BigClassIndexData>(){}.getType());
mAll.setText(indexData.getSchool_big_classroom_count());
mAll_people.setText(indexData.getUsers_count());
mAll_class.setText(indexData.getClass_count());
}
@Override
public void onError(Throwable ex, boolean isOnCallback) {
}
@Override
public void onCancelled(CancelledException cex) {
}
@Override
public void onFinished() {
} });
}
示例6: Get
import org.xutils.http.RequestParams; //导入方法依赖的package包/类
/**
* 发送get请求
* @param <T>
*/
public static <T> Cancelable Get(String url,Map<String,String> map,CommonCallback<T> callback){
RequestParams params=new RequestParams(url);
if(null!=map){
for(Map.Entry<String, String> entry : map.entrySet()){
params.addQueryStringParameter(entry.getKey(), entry.getValue());
}
}
Cancelable cancelable = x.http().get(params, callback);
return cancelable;
}