如何使用 DefaultHttpClient 写入 OutputStream?
2022-09-03 16:37:15
我如何获得使用?OutputStream
org.apache.http.impl.client.DefaultHttpClient
我想将一个长字符串写入输出流。
使用时,您将实现它,如下所示:HttpURLConnection
HttpURLConnection connection = (HttpURLConnection)url.openConnection();
OutputStream out = connection.getOutputStream();
Writer wout = new OutputStreamWriter(out);
writeXml(wout);
有没有一种使用与我上面类似的方法?我该如何写到一个 using 而不是 ?DefaultHttpClient
OutputStream
DefaultHttpClient
HttpURLConnection
例如
DefaultHttpClient client = new DefaultHttpClient();
OutputStream outstream = (get OutputStream somehow)
Writer wout = new OutputStreamWriter(out);