Package org.apache.http.client.utils

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


            uriBuilder.setHost(httpForward.getHost());
            uriBuilder.setPort(httpForward.getPort());
            uriBuilder.setScheme(httpForward.getScheme().name().toLowerCase());
            for (Parameter parameter : httpRequest.getQueryStringParameters()) {
                for (String value : parameter.getValues()) {
                    uriBuilder.addParameter(parameter.getName(), value);
                }
            }
            httpRequest.withURL(uriBuilder.toString());
            httpRequest.replaceHeader(header(HttpHeaders.Names.HOST, String.format("%s:%d", uriBuilder.getHost(), uriBuilder.getPort())));
        } catch (URISyntaxException e) {
View Full Code Here


    logger.debug("Go to perform JIRA REST API call to the {} with parameters {}", url, params);

    URIBuilder builder = new URIBuilder(url);
    if (params != null) {
      for (NameValuePair param : params) {
        builder.addParameter(param.getName(), param.getValue());
      }
    }
    HttpGet method = new HttpGet(builder.build());
    method.addHeader("Accept", "application/json");
    try {
View Full Code Here

      // write all params for image upload request as query itself.
      // Request body contains the image to be uploaded.
      Map<String, String> params = ImageServlet.getParamsForPutImage(storage,
          txId, imageFile.length(), nnf);
      for (Entry<String, String> entry : params.entrySet()) {
        uriBuilder.addParameter(entry.getKey(), entry.getValue());
      }

      URL urlWithParams = uriBuilder.build().toURL();
      connection = (HttpURLConnection) connectionFactory.openConnection(
          urlWithParams, UserGroupInformation.isSecurityEnabled());
View Full Code Here

  @Override
  public String buildAuthRequestUrl(ServerConfiguration serverConfig, RegisteredClient clientConfig, String redirectUri, String nonce, String state, Map<String, String> options) {
    try {

      URIBuilder uriBuilder = new URIBuilder(serverConfig.getAuthorizationEndpointUri());
      uriBuilder.addParameter("response_type", "code");
      uriBuilder.addParameter("client_id", clientConfig.getClientId());
      uriBuilder.addParameter("scope", Joiner.on(" ").join(clientConfig.getScope()));

      uriBuilder.addParameter("redirect_uri", redirectUri);
View Full Code Here

  public String buildAuthRequestUrl(ServerConfiguration serverConfig, RegisteredClient clientConfig, String redirectUri, String nonce, String state, Map<String, String> options) {
    try {

      URIBuilder uriBuilder = new URIBuilder(serverConfig.getAuthorizationEndpointUri());
      uriBuilder.addParameter("response_type", "code");
      uriBuilder.addParameter("client_id", clientConfig.getClientId());
      uriBuilder.addParameter("scope", Joiner.on(" ").join(clientConfig.getScope()));

      uriBuilder.addParameter("redirect_uri", redirectUri);

      uriBuilder.addParameter("nonce", nonce);
View Full Code Here

    try {

      URIBuilder uriBuilder = new URIBuilder(serverConfig.getAuthorizationEndpointUri());
      uriBuilder.addParameter("response_type", "code");
      uriBuilder.addParameter("client_id", clientConfig.getClientId());
      uriBuilder.addParameter("scope", Joiner.on(" ").join(clientConfig.getScope()));

      uriBuilder.addParameter("redirect_uri", redirectUri);

      uriBuilder.addParameter("nonce", nonce);
View Full Code Here

      URIBuilder uriBuilder = new URIBuilder(serverConfig.getAuthorizationEndpointUri());
      uriBuilder.addParameter("response_type", "code");
      uriBuilder.addParameter("client_id", clientConfig.getClientId());
      uriBuilder.addParameter("scope", Joiner.on(" ").join(clientConfig.getScope()));

      uriBuilder.addParameter("redirect_uri", redirectUri);

      uriBuilder.addParameter("nonce", nonce);

      uriBuilder.addParameter("state", state);
View Full Code Here

      uriBuilder.addParameter("client_id", clientConfig.getClientId());
      uriBuilder.addParameter("scope", Joiner.on(" ").join(clientConfig.getScope()));

      uriBuilder.addParameter("redirect_uri", redirectUri);

      uriBuilder.addParameter("nonce", nonce);

      uriBuilder.addParameter("state", state);

      // Optional parameters:
      for (Entry<String, String> option : options.entrySet()) {
View Full Code Here

      uriBuilder.addParameter("redirect_uri", redirectUri);

      uriBuilder.addParameter("nonce", nonce);

      uriBuilder.addParameter("state", state);

      // Optional parameters:
      for (Entry<String, String> option : options.entrySet()) {
        uriBuilder.addParameter(option.getKey(), option.getValue());
      }
View Full Code Here

      uriBuilder.addParameter("state", state);

      // Optional parameters:
      for (Entry<String, String> option : options.entrySet()) {
        uriBuilder.addParameter(option.getKey(), option.getValue());
      }

      return uriBuilder.build().toString();

    } catch (URISyntaxException e) {
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.