当前位置: 首页>>代码示例>>Java>>正文


Java RequestParams.addBodyParameter方法代码示例

本文整理汇总了Java中com.lidroid.xutils.http.RequestParams.addBodyParameter方法的典型用法代码示例。如果您正苦于以下问题:Java RequestParams.addBodyParameter方法的具体用法?Java RequestParams.addBodyParameter怎么用?Java RequestParams.addBodyParameter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.lidroid.xutils.http.RequestParams的用法示例。


在下文中一共展示了RequestParams.addBodyParameter方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: doDonate

import com.lidroid.xutils.http.RequestParams; //导入方法依赖的package包/类
void doDonate(int love_id, String money){
    RequestParams params = new RequestParams();
    params.addHeader("authorization", loginData.getToken());
    params.addBodyParameter("love_id", love_id + "");
    params.addBodyParameter("money", money);

    HttpUtils httpUtils = new HttpUtils();
    httpUtils.configCurrentHttpCacheExpiry(1000);
    httpUtils.send(HttpRequest.HttpMethod.POST, ApiStores.donate, params, new RequestCallBack<String>() {
        @Override
        public void onSuccess(com.lidroid.xutils.http.ResponseInfo<String> responseInfo) {
            Toast.makeText(context, "捐赠成功", Toast.LENGTH_SHORT).show();
            et_donate.setText("");
            getDetails(donation.id);
            CenterFragment.instance.getMyInfo();
        }

        @Override
        public void onFailure(HttpException e, String s) {
            Toast.makeText(context, "请求失败" + s, Toast.LENGTH_SHORT).show();
            Log.e("aaa", e.getMessage());
            Log.e("aaa", s);
        }
    });
}
 
开发者ID:mangestudio,项目名称:GCSApp,代码行数:26,代码来源:DonateDetailActivity.java

示例2: uploadApply

import com.lidroid.xutils.http.RequestParams; //导入方法依赖的package包/类
public void uploadApply(final String certificate, final String name, final String position, final String introduction, final String investorsProjects){
    RequestParams params = new RequestParams();
    params.addHeader("authorization", loginData.getToken());
    params.addBodyParameter("certificate", certificate);
    params.addBodyParameter("name", name);
    params.addBodyParameter("position", position);
    params.addBodyParameter("introduction", introduction);
    params.addBodyParameter("investorsProjects", investorsProjects);

    HttpUtils httpUtils = new HttpUtils();
    httpUtils.send(HttpMethod.POST, "http://116.62.228.37:8000/mine/investors", params, new RequestCallBack<String>() {
        @Override
        public void onSuccess(com.lidroid.xutils.http.ResponseInfo<String> responseInfo) {
            Toast.makeText(delegate.getActivity(), "已提交申请", Toast.LENGTH_SHORT).show();
            delegate.setStatus(3);
        }

        @Override
        public void onFailure(HttpException e, String s) {
            ToastUtil.showToast("uploadFiles failed", delegate.getActivity());
            Log.e("aaa", e.getMessage());
            Log.e("aaa", s);
        }
    });
}
 
开发者ID:mangestudio,项目名称:GCSApp,代码行数:26,代码来源:InvestorsPresenter.java

示例3: editInfoRequest

import com.lidroid.xutils.http.RequestParams; //导入方法依赖的package包/类
public void editInfoRequest(final String oldPassword, final String password, INetWorkListener netWorkListener) {
    NetWorkTask netWorkTask = new NetWorkTask() {
        @Override
        public HttpRequest.HttpMethod getHttpMethod() {
            return HttpRequest.HttpMethod.POST;
        }

        @Override
        public String getUrl() {
            return NetWorkConfig.getHttpApiPath() + "/user/updatePassword.do";
        }

        @Override
        public RequestParams getRequestParams() {
            RequestParams params = new RequestParams();
            params.addBodyParameter("oldPassword", oldPassword);
            params.addBodyParameter("newPassword", password);
            return params;
        }
    };
    netWorkTask.setNetWorkListener(netWorkListener);
    netWorkTask.sendHttpRequest();
}
 
开发者ID:lujianzhi,项目名称:photoalbum,代码行数:24,代码来源:PhotoAlbumNetWork.java

示例4: deletePhotoRequest

import com.lidroid.xutils.http.RequestParams; //导入方法依赖的package包/类
public void deletePhotoRequest(final String id, final String belongId, INetWorkListener netWorkListener) {
    NetWorkTask netWorkTask = new NetWorkTask() {
        @Override
        public HttpRequest.HttpMethod getHttpMethod() {
            return HttpRequest.HttpMethod.POST;
        }

        @Override
        public String getUrl() {
            return NetWorkConfig.getHttpApiPath() + "/photo/delete.do";
        }

        @Override
        public RequestParams getRequestParams() {
            RequestParams params = new RequestParams();
            params.addBodyParameter("id", id);
            params.addBodyParameter("belongId", belongId);
            return params;
        }
    };
    netWorkTask.setNetWorkListener(netWorkListener);
    netWorkTask.sendHttpRequest();
}
 
开发者ID:lujianzhi,项目名称:photoalbum,代码行数:24,代码来源:PhotoAlbumNetWork.java

示例5: voteRequest

import com.lidroid.xutils.http.RequestParams; //导入方法依赖的package包/类
public void voteRequest(final String photoId, final String belongId, final String vote, INetWorkListener netWorkListener) {
    NetWorkTask netWorkTask = new NetWorkTask() {
        @Override
        public HttpRequest.HttpMethod getHttpMethod() {
            return HttpRequest.HttpMethod.POST;
        }

        @Override
        public String getUrl() {
            return NetWorkConfig.getHttpApiPath() + "/vote/vote.do";
        }

        @Override
        public RequestParams getRequestParams() {
            RequestParams params = new RequestParams();
            params.addBodyParameter("photoId", photoId);
            params.addBodyParameter("voteValue", vote);
            return params;
        }
    };
    netWorkTask.setNetWorkListener(netWorkListener);
    netWorkTask.sendHttpRequest();
}
 
开发者ID:lujianzhi,项目名称:photoalbum,代码行数:24,代码来源:PhotoAlbumNetWork.java

示例6: deleteCommentRequest

import com.lidroid.xutils.http.RequestParams; //导入方法依赖的package包/类
public void deleteCommentRequest(final int commentId, INetWorkListener netWorkListener) {
    NetWorkTask netWorkTask = new NetWorkTask() {
        @Override
        public HttpRequest.HttpMethod getHttpMethod() {
            return HttpRequest.HttpMethod.POST;
        }

        @Override
        public String getUrl() {
            return NetWorkConfig.getHttpApiPath() + "/comment/delete.do";
        }

        @Override
        public RequestParams getRequestParams() {
            RequestParams params = new RequestParams();
            params.addBodyParameter("id", String.valueOf(commentId));
            return params;
        }
    };
    netWorkTask.setNetWorkListener(netWorkListener);
    netWorkTask.sendHttpRequest();
}
 
开发者ID:lujianzhi,项目名称:photoalbum,代码行数:23,代码来源:PhotoAlbumNetWork.java

示例7: commitCommentRequest

import com.lidroid.xutils.http.RequestParams; //导入方法依赖的package包/类
public void commitCommentRequest(final String commentContent, final int photoId, INetWorkListener netWorkListener) {
    NetWorkTask netWorkTask = new NetWorkTask() {
        @Override
        public HttpRequest.HttpMethod getHttpMethod() {
            return HttpRequest.HttpMethod.POST;
        }

        @Override
        public String getUrl() {
            return NetWorkConfig.getHttpApiPath() + "/comment/add.do";
        }

        @Override
        public RequestParams getRequestParams() {
            RequestParams params = new RequestParams();
            params.addBodyParameter("content", commentContent);
            params.addBodyParameter("photoId", String.valueOf(photoId));
            return params;
        }
    };
    netWorkTask.setNetWorkListener(netWorkListener);
    netWorkTask.sendHttpRequest();
}
 
开发者ID:lujianzhi,项目名称:photoalbum,代码行数:24,代码来源:PhotoAlbumNetWork.java

示例8: setCoverRequest

import com.lidroid.xutils.http.RequestParams; //导入方法依赖的package包/类
public void setCoverRequest(final String photoUrl, final int albumId, INetWorkListener netWorkListener) {
    NetWorkTask netWorkTask = new NetWorkTask() {
        @Override
        public HttpRequest.HttpMethod getHttpMethod() {
            return HttpRequest.HttpMethod.POST;
        }

        @Override
        public String getUrl() {
            return NetWorkConfig.getHttpApiPath() + "/album/setCover.do";
        }

        @Override
        public RequestParams getRequestParams() {
            RequestParams params = new RequestParams();
            params.addBodyParameter("url", photoUrl);
            params.addBodyParameter("id", String.valueOf(albumId));
            return params;
        }
    };
    netWorkTask.setNetWorkListener(netWorkListener);
    netWorkTask.sendHttpRequest();
}
 
开发者ID:lujianzhi,项目名称:photoalbum,代码行数:24,代码来源:PhotoAlbumNetWork.java

示例9: getAllPhoto

import com.lidroid.xutils.http.RequestParams; //导入方法依赖的package包/类
public void getAllPhoto(final String belongId, INetWorkListener netWorkListener) {
    NetWorkTask netWorkTask = new NetWorkTask() {
        @Override
        public HttpRequest.HttpMethod getHttpMethod() {
            return HttpRequest.HttpMethod.POST;
        }

        @Override
        public String getUrl() {
            return NetWorkConfig.getHttpApiPath() + "/photo/findAll.do";
        }

        @Override
        public RequestParams getRequestParams() {
            RequestParams requestParams = new RequestParams();
            requestParams.addBodyParameter("belongId", belongId);
            return requestParams;
        }
    };
    netWorkTask.setNetWorkListener(netWorkListener);
    netWorkTask.sendHttpRequest();
}
 
开发者ID:lujianzhi,项目名称:photoalbum,代码行数:23,代码来源:PhotoAlbumNetWork.java

示例10: addPhotoRequest

import com.lidroid.xutils.http.RequestParams; //导入方法依赖的package包/类
public void addPhotoRequest(final String belongId, final File file, final String photoName, INetWorkListener netWorkListener) {
    NetWorkTask netWorkTask = new NetWorkTask() {
        @Override
        public HttpRequest.HttpMethod getHttpMethod() {
            return HttpRequest.HttpMethod.POST;
        }

        @Override
        public String getUrl() {
            return NetWorkConfig.getHttpApiPath() + "/photo/upload.do";
        }

        @Override
        public RequestParams getRequestParams() {
            RequestParams requestParams = new RequestParams();
            requestParams.addHeader("enctype", "multipart/form-data");
            requestParams.addBodyParameter("belongId", belongId);
            requestParams.addBodyParameter("file", file);
            requestParams.addBodyParameter("name", photoName);
            return requestParams;
        }
    };
    netWorkTask.setNetWorkListener(netWorkListener);
    netWorkTask.sendHttpRequest();
}
 
开发者ID:lujianzhi,项目名称:photoalbum,代码行数:26,代码来源:PhotoAlbumNetWork.java

示例11: deleteAlbumRequest

import com.lidroid.xutils.http.RequestParams; //导入方法依赖的package包/类
public void deleteAlbumRequest(final String id, INetWorkListener netWorkListener) {
    NetWorkTask netWorkTask = new NetWorkTask() {
        @Override
        public HttpRequest.HttpMethod getHttpMethod() {
            return HttpRequest.HttpMethod.POST;
        }

        @Override
        public String getUrl() {
            return NetWorkConfig.getHttpApiPath() + "/album/delete.do";
        }

        @Override
        public RequestParams getRequestParams() {
            RequestParams params = new RequestParams();
            params.addBodyParameter("id", id);
            return params;
        }
    };
    netWorkTask.setNetWorkListener(netWorkListener);
    netWorkTask.sendHttpRequest();
}
 
开发者ID:lujianzhi,项目名称:photoalbum,代码行数:23,代码来源:PhotoAlbumNetWork.java

示例12: addAlbumRequest

import com.lidroid.xutils.http.RequestParams; //导入方法依赖的package包/类
public void addAlbumRequest(final String name, final int type, INetWorkListener netWorkListener) {
    NetWorkTask netWorkTask = new NetWorkTask() {
        @Override
        public HttpRequest.HttpMethod getHttpMethod() {
            return HttpRequest.HttpMethod.POST;
        }

        @Override
        public String getUrl() {
            return NetWorkConfig.getHttpApiPath() + "/album/add.do";
        }

        @Override
        public RequestParams getRequestParams() {
            RequestParams params = new RequestParams();
            params.addBodyParameter("name", name);
            params.addBodyParameter("type", String.valueOf(type));
            return params;
        }
    };
    netWorkTask.sendHttpRequest();
    netWorkTask.setNetWorkListener(netWorkListener);
}
 
开发者ID:lujianzhi,项目名称:photoalbum,代码行数:24,代码来源:PhotoAlbumNetWork.java

示例13: login

import com.lidroid.xutils.http.RequestParams; //导入方法依赖的package包/类
public void login(final String userName, final String password, INetWorkListener netWorkListener) {
    NetWorkTask netWorkTask = new NetWorkTask() {
        @Override
        public HttpRequest.HttpMethod getHttpMethod() {
            return HttpRequest.HttpMethod.POST;
        }

        @Override
        public String getUrl() {
            return NetWorkConfig.getHttpApiPath() + "/login/login.do";
        }

        @Override
        public RequestParams getRequestParams() {
            RequestParams params = new RequestParams();
            params.addBodyParameter("userName", userName);
            params.addBodyParameter("password", password);
            return params;
        }
    };
    netWorkTask.setNetWorkListener(netWorkListener);
    netWorkTask.sendHttpRequest();
}
 
开发者ID:lujianzhi,项目名称:photoalbum,代码行数:24,代码来源:PhotoAlbumNetWork.java

示例14: registerRequest

import com.lidroid.xutils.http.RequestParams; //导入方法依赖的package包/类
public void registerRequest(final String userName, final String password, INetWorkListener netWorkListener) {
    NetWorkTask netWorkTask = new NetWorkTask() {
        @Override
        public HttpRequest.HttpMethod getHttpMethod() {
            return HttpRequest.HttpMethod.POST;
        }

        @Override
        public String getUrl() {
            return NetWorkConfig.getHttpApiPath() + "/login/register.do";
        }

        @Override
        public RequestParams getRequestParams() {
            RequestParams params = new RequestParams();
            params.addBodyParameter("userName", userName);
            params.addBodyParameter("password", password);
            return params;
        }
    };
    netWorkTask.setNetWorkListener(netWorkListener);
    netWorkTask.sendHttpRequest();
}
 
开发者ID:lujianzhi,项目名称:photoalbum,代码行数:24,代码来源:PhotoAlbumNetWork.java

示例15: getCouldBookInfoByPost

import com.lidroid.xutils.http.RequestParams; //导入方法依赖的package包/类
/**
 * 轮询验证地址正确后保存
 */
public static void getCouldBookInfoByPost(final Context context) {
	HttpUtils http = new HttpUtils();
	RequestParams params = new RequestParams();
	params.addBodyParameter("name", "ydsc8.8");
	http.send(HttpMethod.POST, HttpConstant.BASE_URL1, params,
			new RequestCallBack<String>() {

				@Override
				public void onSuccess(ResponseInfo<String> responseInfo) {
					// TODO Auto-generated method stub
					Toast.showLong(context, "返回成功 :" + responseInfo.result);

				}

				@Override
				public void onFailure(HttpException error, String msg) {
					// TODO Auto-generated method stub
					Toast.showLong(context, "返回失败 :" + msg);
				}
			});
}
 
开发者ID:justingboy,项目名称:CouldBooks,代码行数:25,代码来源:HttpOperator.java


注:本文中的com.lidroid.xutils.http.RequestParams.addBodyParameter方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。