本文整理匯總了Java中com.loopj.android.http.RequestParams.put方法的典型用法代碼示例。如果您正苦於以下問題:Java RequestParams.put方法的具體用法?Java RequestParams.put怎麽用?Java RequestParams.put使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.loopj.android.http.RequestParams
的用法示例。
在下文中一共展示了RequestParams.put方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: executeSample
import com.loopj.android.http.RequestParams; //導入方法依賴的package包/類
@Override
public RequestHandle executeSample(AsyncHttpClient client, String URL, Header[] headers, HttpEntity entity, ResponseHandlerInterface responseHandler) {
RequestParams params = new RequestParams();
params.setUseJsonStreamer(true);
JSONObject body;
if (isRequestBodyAllowed() && (body = getBodyTextAsJSON()) != null) {
try {
Iterator keys = body.keys();
Log.d(LOG_TAG, "JSON data:");
while (keys.hasNext()) {
String key = (String) keys.next();
Log.d(LOG_TAG, " " + key + ": " + body.get(key));
params.put(key, body.get(key).toString());
}
} catch (JSONException e) {
Log.w(LOG_TAG, "Unable to retrieve a JSON value", e);
}
}
return client.post(this, URL, headers, params,
RequestParams.APPLICATION_JSON, responseHandler);
}
示例2: getTweetCommentList
import com.loopj.android.http.RequestParams; //導入方法依賴的package包/類
/**
* 請求動彈評論列表
*
* @param sourceId 動彈id
* @param handler 回調
*/
public static void getTweetCommentList(long sourceId, String pageToken, TextHttpResponseHandler handler) {
RequestParams params = new RequestParams();
params.put("sourceId", sourceId);
params.put("pageToken", pageToken);
ApiHttpClient.get("action/apiv2/tweet_comments", params, handler);
}
示例3: getDynamicDetail
import com.loopj.android.http.RequestParams; //導入方法依賴的package包/類
/**
* 動態詳情
*
* @param activeid
* @param teamid
* @param uid
* @param handler
*/
@Deprecated
public static void getDynamicDetail(int activeid, int teamid, int uid
, AsyncHttpResponseHandler handler) {
RequestParams params = new RequestParams();
params.put("teamid", teamid);
params.put("uid", uid);
params.put("activeid", activeid);
ApiHttpClient.get("action/api/team_active_detail", params, handler);
}
示例4: register
import com.loopj.android.http.RequestParams; //導入方法依賴的package包/類
/**
* register user info
*
* @param username username
* @param password pwd
* @param gender gender
* @param phoneToken token
* @param handler handler
*/
public static void register(String username, String password, int gender
, String phoneToken, TextHttpResponseHandler handler) {
RequestParams params = new RequestParams();
params.put("username", username);
params.put("password", password);
params.put("gender", gender);
params.put("phoneToken", phoneToken);
post("action/apiv2/account_register", params, handler);
}
示例5: getParams
import com.loopj.android.http.RequestParams; //導入方法依賴的package包/類
public RequestParams getParams() {
RequestParams params = new RequestParams();
params.put("vender_id", vendorId);
params.put("device_id", deviceId);
params.put("serial", serial);
params.put("android_device_unique_id", androidDeviceUniqueId);
params.put("android_user_unique_id", androidUserUniqueId);
params.put("android_device_info", androidDeviceInfo);
params.put("android_os_ver", androidOSVer);
params.put("lib_version", libVersion);
params.put("device_info", deviceInfo);
return params;
}
示例6: getEventApplies
import com.loopj.android.http.RequestParams; //導入方法依賴的package包/類
/**
* 獲取某活動已出席的人員列表
*
* @param eventId
* @param pageIndex
* @param handler
*/
@Deprecated
public static void getEventApplies(int eventId, int pageIndex,
AsyncHttpResponseHandler handler) {
RequestParams params = new RequestParams();
params.put("pageIndex", pageIndex);
params.put("event_id", eventId);
params.put("pageSize", AppContext.PAGE_SIZE);
ApiHttpClient.get("action/api/event_attend_user", params, handler);
}
示例7: getDiaryFromWhichWeek
import com.loopj.android.http.RequestParams; //導入方法依賴的package包/類
/**
* 獲取指定周周報
*
* @param teamid
* @param year
* @param week
* @param handler
*/
@Deprecated
public static void getDiaryFromWhichWeek(int teamid, int year, int week
, AsyncHttpResponseHandler handler) {
RequestParams params = new RequestParams();
params.put("teamid", teamid);
params.put("year", year);
params.put("week", week);
ApiHttpClient.get("action/api/team_diary_list", params, handler);
}
示例8: getUserFansOrFlows
import com.loopj.android.http.RequestParams; //導入方法依賴的package包/類
/**
* @param type {@link #TYPE_USER_FLOWS ,#TYPE_USER_FANS}
* @param userId userId
* @param pageToken pageToken
* @param handler handler
*/
public static void getUserFansOrFlows(int type, long userId, String pageToken, TextHttpResponseHandler handler) {
if (userId <= 0) return;
RequestParams params = new RequestParams();
params.put("id", userId);
params.put("pageToken", pageToken);
String uri = "user_follows";
if (type == TYPE_USER_FANS) {
uri = "user_fans";
}
ApiHttpClient.get("action/apiv2/" + uri, params, handler);
}
示例9: getUserDynamic
import com.loopj.android.http.RequestParams; //導入方法依賴的package包/類
/**
* 獲取指定用戶的動態
*/
@Deprecated
public static void getUserDynamic(int teamid, String uid, int pageIndex,
AsyncHttpResponseHandler handler) {
RequestParams params = new RequestParams();
params.put("teamid", teamid);
params.put("pageIndex", pageIndex);
params.put("pageSize", 20);
params.put("type", "all");
params.put("uid", uid);
ApiHttpClient.get("action/api/team_active_list", params, handler);
}
示例10: delFavorite
import com.loopj.android.http.RequestParams; //導入方法依賴的package包/類
@Deprecated
public static void delFavorite(int uid, long objid, int type,
AsyncHttpResponseHandler handler) {
RequestParams params = new RequestParams();
params.put("uid", uid);
params.put("objid", objid);
params.put("type", type);
post("action/api/favorite_delete", params, handler);
}
示例11: pubTweet
import com.loopj.android.http.RequestParams; //導入方法依賴的package包/類
/**
* 發布動彈
* 鏈接 http://doc.oschina.net/app_v2?t=105522
*
* @param content 內容
* @param imagesToken 圖片token
* @param audioToken 語音token
* @param share 相關分享節點,僅僅關注 {@link About.Share#id}, {@link About.Share#type},
* {@link About.Share#fromTweetId}
* @param handler 回調
*/
public static void pubTweet(String content, String imagesToken, String audioToken, About.Share share, AsyncHttpResponseHandler handler) {
if (TextUtils.isEmpty(content))
throw new NullPointerException("content is not null.");
RequestParams params = new RequestParams();
params.put("content", content);
params.put("images", imagesToken);
params.put("audio", audioToken);
if (About.check(share)) {
params.put("aboutId", share.id);
params.put("aboutType", share.type);
params.put("aboutFromTweetId", share.fromTweetId);
}
post("action/apiv2/tweet", params, handler);
}
示例12: getUserQuestionList
import com.loopj.android.http.RequestParams; //導入方法依賴的package包/類
/**
* 請求用戶自己的博客列表
*
* @param pageToken 請求上下頁數據令牌
* @param handler AsyncHttpResponseHandler
*/
public static void getUserQuestionList(String pageToken, long userId, AsyncHttpResponseHandler handler) {
if (userId <= 0) return;
RequestParams params = new RequestParams();
params.put("pageToken", pageToken);
params.put("authorId", userId);
ApiHttpClient.get("action/apiv2/question", params, handler);
}
示例13: teamList
import com.loopj.android.http.RequestParams; //導入方法依賴的package包/類
/**
* 獲取team列表
*
* @param handler
*/
@Deprecated
public static void teamList(AsyncHttpResponseHandler handler, Context context) {
RequestParams params = new RequestParams();
params.put("uid", AccountHelper.getUserId());
ApiHttpClient.get("action/api/team_list", params, handler);
}
示例14: mapToRequestParams
import com.loopj.android.http.RequestParams; //導入方法依賴的package包/類
/**
* map轉RequestParams
*
* @param map
* @return
*/
public static RequestParams mapToRequestParams(Map<String, Object> map) {
RequestParams params = new RequestParams();
// params.setContentEncoding(HTTP.UTF_8);
try {
for (Map.Entry<String, Object> entry : map.entrySet()) {
String key = entry.getKey();
if (key == null) {
continue;
}
Object object = entry.getValue();
if (object == null) {
object = "";
}
if (object instanceof File) {
params.put(key, (File) object);
} else if (object instanceof File[]) {
// HQ項目需要這樣用才可以上傳成功
// params.put("file[]", (File[]) object, "image/jpeg", "file[]");
// String contentType = MHttpBridge.CONTENT_TYPE_IMAGE;
// if (map.containsKey(MHttpBridge.KEY_CONTENT_TYPE)) {
// contentType = (String) map.get(MHttpBridge.KEY_CONTENT_TYPE);
// }
// params.put(key, (File[]) object, contentType, key);
params.put(key, (File[]) object);
} else {
String values = object.toString();
params.put(key, values);
}
}
} catch (Exception e) {
e.printStackTrace();
}
return params;
}
示例15: syncSignUserInfo
import com.loopj.android.http.RequestParams; //導入方法依賴的package包/類
public static void syncSignUserInfo(long sourceId, TextHttpResponseHandler handler) {
if (sourceId <= 0) return;
RequestParams params = new RequestParams();
params.put("sourceId", sourceId);
ApiHttpClient.post("action/apiv2/event_apply_info", params, handler);
}