how do i SET content length?
843841Feb 17 2006 — edited Feb 22 2006hello 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.