Package org.apache.commons.httpclient.methods

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


    PostMethod method = new PostMethod(url);

    NameValuePair[] postData = new NameValuePair[1];
        postData[0] = new NameValuePair("XDEBUG_SESSION", "default");
       
        method.addParameters(postData);

    try {
      System.out.println("sending http request with debugging flag");
     
      debugger.terminate(url, client.executeMethod(method));
View Full Code Here


          new NameValuePair("title", title),
          new NameValuePair("url", url),
          new NameValuePair("excerpt", excerpt),
          new NameValuePair("blog_name", blogName)
        };
        postMethod.addParameters(data);

        trackBackResponseCode = new Integer(httpClient.executeMethod(postMethod));
        trackBackResponseMessage = postMethod.getResponseBodyAsString();
      } catch (Exception e) {
        log.error(e.getMessage(), e);
View Full Code Here

   * @return the raw XML string produced by the query; <code>null</code>
   *         otherwise
   */
  private String sendXML(User user, RequestBuilder requestBuilder) {
    PostMethod method = createAuthenticatedPostMethod(user);
    method.addParameters(requestBuilder.getParameters());
    // if (params != null && !params.isEmpty()) {
    // for (Map.Entry entry : params.entrySet()) {
    // method.addParameter(new NameValuePair((String) entry.getKey(), (String)
    // entry.getValue()));
    // }
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

        }

        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

        }

        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

        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

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.