Package org.apache.commons.httpclient.methods

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


        method.setRequestEntity(new StringRequestEntity(body, "text/xml", "UTF-8"));
        logPostRequest(method);
        client.executeMethod(method);
        String responseStr = readInputStream(method.getResponseBodyAsStream());
        logPostResponse(method, responseStr);
        method.releaseConnection();
        lastUrl = method.getURI().toString();
        return responseStr;
    }

    /**
 
View Full Code Here


        final int status = httpClient.executeMethod(post);
        assertEquals("Unexpected status response", 201, status);

        assertEquals("Thanks!", post.getResponseBodyAsString());

        post.releaseConnection();
    }
}
View Full Code Here

        sb.append(new String(buf, 0, len));
      data = sb.toString();
    } catch (IOException e) {
      e.printStackTrace();
    } finally {
      mPost.releaseConnection();
    }
    if (!(statusCode == 200 && checkResponse(data))) {
      JOptionPane.showMessageDialog(FBEdit.getInstance().getframe(),
          "Beim Einlesen der Daten ist ein Fehler aufgetreten!",
          "Fehler", 0);
View Full Code Here

        result = true;
      else
        JOptionPane.showMessageDialog(fbedit, FBEdit.getMessage(""),
            FBEdit.getMessage("error"), 0);

      mPost.releaseConnection();
    } catch (IOException ex) {
      Logger.getLogger(Utils.class.getName()).log(Level.SEVERE, null, ex);
    }

    return result;
View Full Code Here

        try {
            this.client.executeMethod(post);
            assertEquals(HttpStatus.SC_OK, post.getStatusCode());
            assertNotNull(post.getResponseBodyAsString());
        } finally {
            post.releaseConnection();
        }
    }

    /**
     * Tests POST via non-authenticating proxy + host auth + connection keep-alive
View Full Code Here

        try {
            this.client.executeMethod(post);
            assertEquals(HttpStatus.SC_OK, post.getStatusCode());
            assertNotNull(post.getResponseBodyAsString());
        } finally {
            post.releaseConnection();
        }
    }

    /**
     * Tests POST via non-authenticating proxy + host auth + connection close
View Full Code Here

        try {
            this.client.executeMethod(post);
            assertEquals(HttpStatus.SC_OK, post.getStatusCode());
            assertNotNull(post.getResponseBodyAsString());
        } finally {
            post.releaseConnection();
        }
    }

    /**
     * Tests POST via non-authenticating proxy + invalid host auth
View Full Code Here

        post.setRequestEntity(new StringRequestEntity("Like tons of stuff"));
        try {
            this.client.executeMethod(post);
            assertEquals(HttpStatus.SC_UNAUTHORIZED, post.getStatusCode());
        } finally {
            post.releaseConnection();
        }
    }

    /**
     * Tests POST via non-authenticating proxy + interactive host auth + connection keep-alive
View Full Code Here

        try {
            this.client.executeMethod(post);
            assertEquals(HttpStatus.SC_OK, post.getStatusCode());
            assertNotNull(post.getResponseBodyAsString());
        } finally {
            post.releaseConnection();
        }
    }

    /**
     * Tests POST via non-authenticating proxy + interactive host auth + connection close
View Full Code Here

        try {
            this.client.executeMethod(post);
            assertEquals(HttpStatus.SC_OK, post.getStatusCode());
            assertNotNull(post.getResponseBodyAsString());
        } finally {
            post.releaseConnection();
        }
    }

    /**
     * Tests POST via authenticating proxy
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.