hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Roland Weber <http-as...@dubioso.net>
Subject Re: Conversion of applet code from java.net.URLConnection to commons-HttpClient
Date Thu, 16 Mar 2006 08:28:51 GMT
Hello Sanjeev,

you best use a PostMethod for uploading:
http://jakarta.apache.org/commons/httpclient/apidocs/org/apache/commons/httpclient/methods/PostMethod.html

We don't have a file-based RequestEntity, but it should
be easy to implement based on the code you've got:
http://jakarta.apache.org/commons/httpclient/apidocs/org/apache/commons/httpclient/methods/RequestEntity.html
The method writeRequest() will give you the OutputStream.

The various .setRequestProperty() calls translate to
setting request headers before executing the method:
http://jakarta.apache.org/commons/httpclient/apidocs/org/apache/commons/httpclient/HttpMethod.html#addRequestHeader(java.lang.String,%20java.lang.String)

hope that helps,
  Roland


---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-user-help@jakarta.apache.org


Mime
View raw message