How do I get an OutputStream
using org.apache.http.impl.client.DefaultHttpClient
?
I'm looking to write a long string to an output stream.
Using HttpURLConnection
you would implement it like so:
HttpURLConnection connection = (HttpURLConnection)url.openConnection();
OutputStream out = connection.getOutputStream();
Writer wout = new OutputStreamWriter(out);
writeXml(wout);
Is there a method using DefaultHttpClient
similar to what I have above? How would I write to an OutputStream
using DefaultHttpClient
instead of HttpURLConnection
?
e.g
DefaultHttpClient client = new DefaultHttpClient();
OutputStream outstream = (get OutputStream somehow)
Writer wout = new OutputStreamWriter(out);