Package org.apache.http.client.utils

Examples of org.apache.http.client.utils.URIBuilder.addParameter()


  @Override
  public byte[] post(String uri, Map<String, String> uriParameters, byte[] content) throws URISyntaxException {
    URIBuilder builder = new URIBuilder(uri);
    for (Entry<String, String> entry : uriParameters.entrySet()) {
      builder.addParameter(entry.getKey(), entry.getValue());
    }
    return client.postData(builder.build().toString(), tokenHolder, content);
  }

  @Override
View Full Code Here


  @Override
  public byte[] postForm(String uri, Map<String, String> uriParameters, Map<String, String> formParameters)
    throws URISyntaxException {
    URIBuilder builder = new URIBuilder(uri);
    for (Entry<String, String> entry : uriParameters.entrySet()) {
      builder.addParameter(entry.getKey(), entry.getValue());
    }
    List<NameValuePair> formParams = new ArrayList<NameValuePair>();
    for (Entry<String, String> entry : formParameters.entrySet()) {
      formParams.add(new BasicNameValuePair(entry.getKey(), entry.getValue()));
    }
View Full Code Here

  @Override
  public byte[] get(String uri, Map<String, String> uriParameters) throws URISyntaxException {
    URIBuilder builder = new URIBuilder(uri);
    for (Entry<String, String> entry : uriParameters.entrySet()) {
      builder.addParameter(entry.getKey(), entry.getValue());
    }
    return client.get(builder.build().toString(), tokenHolder);
  }
}
View Full Code Here

        }
        URIBuilder apiUrlBuilder = new URIBuilder(apiUrl);
        for (Map.Entry<String, ? extends Object> param : params.entrySet()) {
            if (param.getValue() instanceof Iterable) {
                for (String single : (Iterable<String>) param.getValue()) {
                    apiUrlBuilder.addParameter(param.getKey() + "[]", single);
                }
            } else {
                apiUrlBuilder.addParameter(param.getKey(), Cloudinary.asString(param.getValue()));
           
        }
View Full Code Here

            if (param.getValue() instanceof Iterable) {
                for (String single : (Iterable<String>) param.getValue()) {
                    apiUrlBuilder.addParameter(param.getKey() + "[]", single);
                }
            } else {
                apiUrlBuilder.addParameter(param.getKey(), Cloudinary.asString(param.getValue()));
           
        }
        DefaultHttpClient client = new DefaultHttpClient();
        URI apiUri = apiUrlBuilder.build();
        HttpUriRequest request = null;
View Full Code Here

    params.put("type", options.get("type"));
    params.put("timestamp", new Long(System.currentTimeMillis() / 1000L).toString());
    signRequest(params, options);
    URIBuilder builder = new URIBuilder(cloudinaryApiUrl("download", options));
    for (Map.Entry<String, Object> param : params.entrySet()) {
      builder.addParameter(param.getKey(), param.getValue().toString());
    }
    return builder.toString();
  }
   
  public String zipDownload(String tag, Map<String, Object> options) throws URISyntaxException {
View Full Code Here

    }
    params.put("transformation", transformation);
    signRequest(params, options);
    URIBuilder builder = new URIBuilder(cloudinaryApiUrl("download_tag.zip", options));
    for (Map.Entry<String, Object> param : params.entrySet()) {
      builder.addParameter(param.getKey(), param.getValue().toString());
    }
    return builder.toString();
  }
   
  protected void initFromUrl(String cloudinaryUrl) {
View Full Code Here

            URIBuilder uriBuilder = new URIBuilder();
            for (Map.Entry<String, Collection<String>> stringCollectionEntry : queryParams.entrySet()) {
                String key = stringCollectionEntry.getKey();
                Collection<String> stringCollection = stringCollectionEntry.getValue();
                String value = joiner.join(stringCollection);
                uriBuilder.addParameter(key, value);
            }
            uriBuilder.setFragment(requestUri.getFragment());
            uriBuilder.setHost(requestUri.getHost());
            uriBuilder.setPath(requestUri.getPath());
            uriBuilder.setPort(requestUri.getPort());
View Full Code Here

    String getEmailVerificationUrl(String email) throws URISyntaxException {
        String mac = crypto.getMac(email);

        URIBuilder uriBuilder = new URIBuilder(baseUrl + "/security/verifyEmail");
        uriBuilder.addParameter("email", email);
        uriBuilder.addParameter("mac", mac);

        return uriBuilder.build().toString();
    }
View Full Code Here

    String getEmailVerificationUrl(String email) throws URISyntaxException {
        String mac = crypto.getMac(email);

        URIBuilder uriBuilder = new URIBuilder(baseUrl + "/security/verifyEmail");
        uriBuilder.addParameter("email", email);
        uriBuilder.addParameter("mac", mac);

        return uriBuilder.build().toString();
    }

    @RequestMapping("/labMembership")
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.