Package org.apache.commons.httpclient.methods

Examples of org.apache.commons.httpclient.methods.PostMethod.addParameter()


    PostMethod post = new PostMethod(getURL());
    post.addParameter("day", _day);
    post.addParameter("month", _month);
    post.addParameter("year", _year);
    post.addParameter("uname", getDownloadUser());
    post.addParameter("pword", getDownloadPassword());
    if (LOG.isDebugEnabled()) {
      LOG.debug("Downloading log from [" + getURL() + "]");
    }
    try {
      client.executeMethod(post);
View Full Code Here


    private static PostMethod postWithRetry(HttpClient httpClient, String location, String... nameAndValues) throws IOException {
        while (true) {
            PostMethod page = new PostMethod(location);
            try {
                for (int i=0; i<nameAndValues.length; i+=2) {
                    page.addParameter(nameAndValues[i],nameAndValues[i+1]);
                }
                int r = httpClient.executeMethod(page);
                if (300<=r && r<309) {
                    location = page.getResponseHeader("Location").getValue();
                    continue;
View Full Code Here

            for ( final Iterator values = params.getParameterValues( name );
                  values.hasNext();
            )
            {
                final String value = (String) values.next();
                post.addParameter( new NameValuePair( name, value ) );
            }
        }

        return post;
    }
View Full Code Here

                }
                final Part [] parts = partList.toArray(new Part[partList.size()]);
                post.setRequestEntity(new MultipartRequestEntity(parts, post.getParams()));
            } else {
                for(Map.Entry<String,String> e : nodeProperties.entrySet()) {
                    post.addParameter(e.getKey(),e.getValue());
                }
            }
        }

        if(requestHeaders != null) {
View Full Code Here

    private String createNewNode(Map<String, String> properties) {
        PostMethod method = new PostMethod(this.baseUri
                + this.createNodeUrlPath);

        for (String key : properties.keySet()) {
            method.addParameter(key, properties.get(key));
        }
        try {
            method.addRequestHeader("Accept", this.contentType);
            this.httpClient.executeMethod(method);
            return method.getResponseHeader("Location").getValue();
View Full Code Here

      {
        filePost.addParameter("user", username);
      }
      if (password != null)
      {
        filePost.addParameter("password", password);
      }
      filePost.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=utf-8");

      final int lastStatus = client.executeMethod(filePost);
      if (lastStatus != HttpStatus.SC_OK)
View Full Code Here

    final PostMethod filePost = new PostMethod(url + service);
    logger.debug("Connecting to '" + url + service + '\'');
    filePost.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=utf-8");
    if (username != null)
    {
      filePost.addParameter("userid", username);
    }
    if (password != null)
    {
      filePost.addParameter("password", password);
    }
View Full Code Here

    {
      filePost.addParameter("userid", username);
    }
    if (password != null)
    {
      filePost.addParameter("password", password);
    }

    final int lastStatus = client.executeMethod(filePost);
    if (lastStatus == HttpStatus.SC_UNAUTHORIZED)
    {
View Full Code Here

  {
    final PostMethod filePost = new PostMethod(fileInfo.getUrl());
    filePost.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=utf-8");
    if (username != null)
    {
      filePost.addParameter("userid", username);
    }
    if (password != null)
    {
      filePost.addParameter("password", password);
    }
View Full Code Here

    {
      filePost.addParameter("userid", username);
    }
    if (password != null)
    {
      filePost.addParameter("password", password);
    }

    try
    {
      final int lastStatus = client.executeMethod(filePost);
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.