本文整理汇总了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);
}
});
}
示例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);
}
});
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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);
}
示例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();
}
示例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();
}
示例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);
}
});
}