com.amazonaws.Request.setParameters()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(7.7k)|赞(0)|评价(0)|浏览(178)

本文整理了Java中com.amazonaws.Request.setParameters方法的一些代码示例,展示了Request.setParameters的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Request.setParameters方法的具体详情如下:
包路径:com.amazonaws.Request
类名称:Request
方法名:setParameters

Request.setParameters介绍

[英]Sets all parameters, clearing any existing values. Note that List values within the parameters Map must use an implementation that supports null values.
[中]设置所有参数,清除所有现有值。请注意,参数映射中的列表值必须使用支持空值的实现。

代码示例

代码示例来源:origin: stackoverflow.com

private Request createRequest(Session session) {
  Request request = Request.newGraphPathRequest(session, "me/friends", null);

  Set<String> fields = new HashSet<String>();
  String[] requiredFields = new String[] { "id", "name", "picture",
      "installed" };
  fields.addAll(Arrays.asList(requiredFields));

  Bundle parameters = request.getParameters();
  parameters.putString("fields", TextUtils.join(",", fields));
  request.setParameters(parameters);

  return request;
}

代码示例来源:origin: aws-amplify/aws-sdk-android

/**
 * Sets all parameters, clearing any existing values.
 *
 * @param parameters the http request parameters.
 * @return the updated request object.
 */
public ApiRequest withParameters(Map<String, String> parameters) {
  request.setParameters(parameters);
  return this;
}

代码示例来源:origin: aws/aws-sdk-java

request.setParameters(originalParameters);
request.setHeaders(originalHeaders);
request.setContent(originalContent);

代码示例来源:origin: stackoverflow.com

Request me = Request.newMeRequest(mCurrentSession, new GraphRequestCallback() {...});
Bundle params = me.getParameters();
params.putString("fields", "email,name");
me.setParameters(params);
me.executeAsync();

代码示例来源:origin: stackoverflow.com

Request request = Request.newUploadPhotoRequest(Session.getActiveSession(), BitmapFactory.decodeResource(_context.getResources(), R.drawable.default_image), uploadPhotoRequestCallback);
Bundle parameters = request.getParameters(); // <-- THIS IS IMPORTANT
parameters.putString(...);
// add more params here
request.setParameters(parameters);
request.executeAsync();

代码示例来源:origin: stackoverflow.com

private void makeFriendsRequest() {
  Request myFriendsRequest = Request.newMyFriendsRequest(Session.getActiveSession(), 
      new Request.GraphUserListCallback() {

    @Override
    public void onCompleted(List<GraphUser> users, Response response) {
      if (response.getError() == null) {
        // Handle response
      }

    }

  });
  // Add birthday to the list of info to get.
  Bundle requestParams = myFriendsRequest.getParameters();
  requestParams.putString("fields", "name,birthday");
  myFriendsRequest.setParameters(requestParams);
  myFriendsRequest.executeAsync();
}

代码示例来源:origin: aws-amplify/aws-sdk-android

@Test
public void testconvertRequestToUrl() throws MalformedURLException {
  final Request<?> request = new DefaultRequest<Void>("Foo");
  request.setContent(new ByteArrayInputStream("testcontent"
      .getBytes(StringUtils.UTF8)));
  request.addHeader("Host", "demo.us-east-1.amazonaws.com");
  // HTTP header containing multiple spaces in a row.
  request.addHeader("x-amz-archive-description", "test  test");
  request.setResourcePath("/");
  request.setEndpoint(URI.create("http://demo.us-east-1.amazonaws.com"));
  final Map<String, String> parameters = new HashMap<String, String>();
  parameters.put("foo", "bar");
  parameters.put("temple", "run");
  request.setParameters(parameters);
  final RuntimeHttpUtils utils = new RuntimeHttpUtils();
  Assert.assertEquals(new URL("http://demo.us-east-1.amazonaws.com/?foo=bar&temple=run"),
      RuntimeHttpUtils.convertRequestToUrl(request, true, false));
}

代码示例来源:origin: com.amazonaws/aws-android-sdk-apigateway-core

/**
 * Sets all parameters, clearing any existing values.
 *
 * @param parameters the http request parameters.
 * @return the updated request object.
 */
public ApiRequest withParameters(Map<String, String> parameters) {
  request.setParameters(parameters);
  return this;
}

代码示例来源:origin: com.amazonaws/aws-java-sdk-core

request.setParameters(originalParameters);
request.setHeaders(originalHeaders);
request.setContent(originalContent);

代码示例来源:origin: aws-amplify/aws-sdk-android

awsRequestMetrics.setCounter(Field.RequestCount, requestCount);
if (requestCount > 1) { // retry
  request.setParameters(originalParameters);
  request.setHeaders(originalHeaders);
  request.setContent(originalContent);

代码示例来源:origin: stackoverflow.com

Request request = new Request(session,"me/taggable_friends",null,HttpMethod.GET);
Bundle bundle = new Bundle();
bundle.putString("fields", "name,picture.type(large)");
request.setParameters(bundle);

代码示例来源:origin: stackoverflow.com

Request request = new Request(session,"me/taggable_friends", null, HttpMethod.GET);
Bundle bundle = new Bundle();
bundle.putString("fields", "name,picture.width(400).height(400)");
request.setParameters(bundle);

代码示例来源:origin: stackoverflow.com

private Request createRequest(Session session2) {
   // TODO Auto-generated method stub
   Request request = Request.newGraphPathRequest(session, "me/friends",
       null);
   Set<String> fields = new HashSet<String>();
   String[] requiredFields = new String[] { "id", "name", "picture" };
   fields.addAll(Arrays.asList(requiredFields));
   Bundle parameters = request.getParameters();
   parameters.putString("fields", TextUtils.join(",", fields));
   request.setParameters(parameters);
   return request;
 }

代码示例来源:origin: stackoverflow.com

private Request newRequest(Session session) {
   Request request = Request.newGraphPathRequest(session, profile.getFacebook_id(), null);
   Set<String> fields = new HashSet<String>();
   String[] requestFields = new String[]{"work, education"};
   fields.addAll(Arrays.asList(requestFields));
   Bundle parameters = request.getParameters();
   parameters.putString("fields", TextUtils.join(",", fields));
   request.setParameters(parameters);
   return request;
 }

代码示例来源:origin: stackoverflow.com

// Make sure the user is logged in first
Request meRequest = Request.newMeRequest(Session.getActiveSession(), yourCallback);
Bundle parameters = new Bundle();
// The fields you want in comma separated list
parameters.putString(fields, "id,name,email");
meRequest.setParameters(parameters);
meRequest.executeAsync();

代码示例来源:origin: stackoverflow.com

Request req = new Request();
Bundle b = new Bundle();
b.putString("privacy","{'value':'EVERYONE'}");
req.setParameters(b);
req.newStatusUpdateRequest(...

代码示例来源:origin: stackoverflow.com

Request request = Request.newUploadVideoRequest(...);
Bundle params = request.getParameters();
params.putString("title", "Your Title Here");
request.setParameters(params);
request.executeAsync();

代码示例来源:origin: stackoverflow.com

Request friendrequest = Request.newMyFriendsRequest(...);

Bundle params = friendrequest.getParameters();
params.putString("fields", "name,id,gender");
friendrequest.setParameters(params);
friendrequest.executeAsync();

代码示例来源:origin: stackoverflow.com

Request request = Request.newUploadPhotoRequest(session, sourceBitmap, new Callback() {...});
Bundle params = request.getParameters();
params.putString("message", "Your Caption Here");
request.setParameters(params);
request.executeAsync();

代码示例来源:origin: IvonaSoftware/ivona-speechcloud-sdk-java

protected void setRequestParameters(Request<ListVoicesRequest> request, ListVoicesRequest listVoicesRequest) {
    Map<String, List<String>> parameters = new HashMap<String, List<String>>();

    if (listVoicesRequest.getVoice() != null) {
      MarshallerHelper.putToMapIfNotNull(parameters, PARAM_VOICE_NAME,
          listVoicesRequest.getVoice().getName());
      MarshallerHelper.putToMapIfNotNull(parameters, PARAM_VOICE_LANGUAGE,
          listVoicesRequest.getVoice().getLanguage());
      MarshallerHelper.putToMapIfNotNull(parameters, PARAM_VOICE_GENDER,
          listVoicesRequest.getVoice().getGender());
    }

    request.setParameters(parameters);
  }
}

相关文章