Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

how do i SET content length?

843841Feb 17 2006 — edited Feb 22 2006
hello all,

im coding a client that needs to send data to a server over HTTP POST method ("speaking" in XMLRPC - but this is not significant). the server requires that when i POST the data i have to set the correct contentType (xml etc...), and the correct Content Length.

the catch is that my app is not a servlet, its a console app that uses the import java.net.* package, and specifically im using HTTPUrlConnection class to write to the server. But there is no method to setContentType and setContentLength in this class. yes the servlet packages do includes such methods, but are there equivalent ones for URLConnection na dHTTPUrlConnection?

Thanks.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 22 2006
Added on Feb 17 2006
2 comments
201 views