Hi,
From an Java-application I want to call a
servlet with a post request that includes a text-file
in the inputstream.
How do I do that ? I tried the following,but I'm confused about how the servlet can read the stream .
URL url = new URL("http://plovdinger:80/xmlReceiver");
URLConnection uc = url.openConnection();
uc.setDoOutput(true);
OutputStream os = uc.getOutputStream();
OutputStream buf = new BufferedOutputStream(os);
OutputStreamWriter out = new OutputStreamWriter(buf,"8859_1");
out.write("one little line\r\n");
out.write("Two little line\r\n");
out.flush();
out.close();
//return the response
readInputStream(uc.getInputStream());