commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adrian Sutton <adrian.sut...@ephox.com>
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
www.ephox.com

-----Original Message-----
From: Thilo Roessler [mailto:el-nino@gmx.li]
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
(Alpha1 
which I downloaded from jakarta.apache.org), this method does not exist. So
I 
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: 
org/apache/commons/logging/LogFactory
        at 
org.apache.commons.httpclient.HttpConnection.<clinit>(HttpConnection.java:85
3)
        at Post141.main(Post141V2.java:42)


Here is a piece of my code:
=============================================================
HttpConnection CPGCon;

CPGCon = new HttpConnection("tn.integration.cpgmarket.com",
						443,
						true);

CPGCon.open();
System.out.println("Connection open");

PostMethod post2CPG;
post2CPG = new
PostMethod("/invoke/CPGmarketTN.partner.push/receiveDocument");
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){
		System.out.println(postHeaders[i].toString());
		i = i + 1;
	}; // while (postHeaders[i].toString() <> "")
}; // if i > 0 then
			
post2CPG.setRequestBody("bla");

CPGCon.close();
System.out.println("Connection closed");
=============================================================

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

Thilo

--
To unsubscribe, e-mail:
<mailto:commons-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail:
<mailto:commons-user-help@jakarta.apache.org>


Mime
View raw message