Package org.apache.commons.httpclient.methods

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


        new NameValuePair("title", "Special:Userlogin"), new NameValuePair("action", "submit"), new NameValuePair("wpName", user),
        new NameValuePair("wpPassword", password), new NameValuePair("wpRemember", remember ? "1" : "0"),
        // new NameValuePair("wpDomain", domain),
        new NameValuePair("wpLoginattempt", "submit")
    };
    method.addParameters(params);

    boolean result;
    try {
      int responseCode = fHttpClient.executeMethod(method);
      String responseBody = method.getResponseBodyAsString();
View Full Code Here


   * @return the raw XML string produced by the query; <code>null</code>
   *         otherwise
   */
  public String sendXML(User user, RequestBuilder requestBuilder) {
    PostMethod method = createAuthenticatedPostMethod(user);
    method.addParameters(requestBuilder.getParameters());
    return executeHttpMethod(method);
  }

  private PostMethod createAuthenticatedPostMethod(User user) {
    PostMethod method = new PostMethod(user.getActionUrl());
View Full Code Here

        new NameValuePair(WP_SECTION, ""), new NameValuePair(WP_STARTTIME, fPageData.getStartTime()),
        new NameValuePair(WP_EDITTIME, fPageData.getEditTime()), new NameValuePair(WP_SCROLLTOP, ""),
        new NameValuePair(WP_TEXTBOX1, newEditText), new NameValuePair(WP_SUMMARY, ""), new NameValuePair(WP_SAVE, "Save page"),
        new NameValuePair(WP_EDITTOKEN, fPageData.getEditToken()), new NameValuePair(WP_AUTOSUMMARY, fPageData.getAutoSummary())
    };
    method.addParameters(params);

    try {

      // Execute the request.
      responseCode = fHttpClient.executeMethod(method);
View Full Code Here

        new NameValuePair("title", "Special:Userlogin"), new NameValuePair("action", "submit"), new NameValuePair("wpName", user),
        new NameValuePair("wpPassword", password), new NameValuePair("wpRemember", remember ? "1" : "0"),
        // new NameValuePair("wpDomain", domain),
        new NameValuePair("wpLoginattempt", "submit")
    };
    method.addParameters(params);

    boolean result;
    try {
      int responseCode = fHttpClient.executeMethod(method);
      String responseBody = method.getResponseBodyAsString();
View Full Code Here

      fLogger.debug("POST to " + url); //$NON-NLS-1$
      PostMethod method = new PostMethod(url);
      method.setDoAuthentication(true);
     
      if(this.parameters.length > 0) {
        method.addParameters(this.parameters);
      } else {
        method.setRequestEntity(new InputStreamRequestEntity(request.getInputStream()));
      }
     
      return executeMethod(method, request, properties);
View Full Code Here

        }

        HttpMethodBase method;
        if (request.getMethodName() == HttpMethodName.POST) {
            PostMethod postMethod = new PostMethod(uri);
            if (nameValuePairs != null) postMethod.addParameters(nameValuePairs);
            method = postMethod;
        } else if (request.getMethodName() == HttpMethodName.GET) {
            GetMethod getMethod = new GetMethod(uri);
            if (nameValuePairs != null) getMethod.setQueryString(nameValuePairs);
            method = getMethod;
View Full Code Here

    fLogger.debug("POST to " + uri); //$NON-NLS-1$
    PostMethod method = new PostMethod(uri);
    method.setDoAuthentication(true);
   
    if(this.parameters.length > 0) {
      method.addParameters(this.parameters);
    } else {
      method.setRequestEntity(new StringRequestEntity(xmlData, "text/xml", "UTF8"));//$NON-NLS-1$  //$NON-NLS-2$
    }
   
    return executeMethod(method, properties);
View Full Code Here

      fLogger.debug("POST to " + url); //$NON-NLS-1$
      PostMethod method = new PostMethod(url);
      method.setDoAuthentication(true);
     
      if(this.parameters.length > 0) {
        method.addParameters(this.parameters);
      } else {
        method.setRequestEntity(new InputStreamRequestEntity(request.getInputStream()));
      }
     
      return executeMethod(method, request, properties);
View Full Code Here

        }
       
        HttpMethodBase method;
        if (request.getMethodName() == HttpMethodName.POST) {
            PostMethod postMethod = new PostMethod(uri);
            if (nameValuePairs != null) postMethod.addParameters(nameValuePairs);
            method = postMethod;
        } else if (request.getMethodName() == HttpMethodName.GET) {
            GetMethod getMethod = new GetMethod(uri);
            if (nameValuePairs != null) getMethod.setQueryString(nameValuePairs);
            method = getMethod;
View Full Code Here

             * otherwise, just use the query string. For all AWS Query services,
             * the best behavior is putting the params in the request body for
             * POST requests, but we can't do that for S3.
             */
            if (request.getContent() == null) {
                if (nameValuePairs != null) postMethod.addParameters(nameValuePairs);
            } else {
                if (nameValuePairs != null) postMethod.setQueryString(nameValuePairs);
                postMethod.setRequestEntity(new RepeatableInputStreamRequestEntity(request));
            }
            method = postMethod;
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.