commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adrian Sutton <>
Subject RE: HTTPClient, PostMethod and setRequestBody
Date Mon, 02 Dec 2002 23:21:12 GMT
HttpClient now has a separate dependancy on commons-logging, previously
commons-logging was a part of HttpClient.  Grab the latest build of
commons-logging and you should be good to go again.

Adrian Sutton, Software Engineer
Ephox Corporation

-----Original Message-----
From: Thilo Roessler []
Sent: Monday, 2 December 2002 8:28 PM
To: Jakarta Commons Users List
Subject: HTTPClient, PostMethod and setRequestBody

Hello to all of you!

As I mentioned in an earlier mail, I try uploding a File to a HTTP-URL using

the PostMethod of HTTPClient. Looking through the API-Documentation on the 
jakarta-homepage, I found a method called "setRequestody".
When trying to use it, i recognized that in my version of HTTP-Client
which I downloaded from, this method does not exist. So
got th latest GUMP-generated binary. There, the desired method existed ... 
unfortunately, other parts of my programm did not work anymore when using 
this Version of HTTPClient.

When running my program, I received the following error:

Exception in thread "main" java.lang.NoClassDefFoundError: 
        at Post141.main(

Here is a piece of my code:
HttpConnection CPGCon;

CPGCon = new HttpConnection("",
System.out.println("Connection open");

PostMethod post2CPG;
post2CPG = new
System.out.println("Post Method created");

post2CPG.setRequestHeader("Content-type", "multipart/form-data");

Header[] postHeaders = post2CPG.getRequestHeaders();

int i;
i = postHeaders.length;
System.out.println("Header-Fields: " + i);
if (i > 0) {
	i = 0;
	while (i < postHeaders.length){
		i = i + 1;
	}; // while (postHeaders[i].toString() <> "")
}; // if i > 0 then

System.out.println("Connection closed");

Is there anybody who has an idea what I am doing wrong?


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message