Yep,
you can do something like so:
URL url = new URL(hostname);
HttpURLConnection conn =
(HttpURLConnection)url.openConnection();
conn.setDoOutput(true);
conn.setRequestMethod("POST");
PrintWriter stream = new
PrintWriter(conn.getOutputStream(), true);
stream.println("xml=" + URLEncoder.encode(xml));
Regards,
Damian
> HI!
>
> I need to make a servlet (or JSP page) to get an external page using the
> method POST. Is it possible with the URLConnection class?
>
> Thanks.
> Guilherme Ceschiatti
- java.lang.IllegalArgumentException: shortname not spe... Guilherme Ceschiatti
- Re: java.lang.IllegalArgumentException: shortnam... Lorin Kobashigawa
- Re: java.lang.IllegalArgumentException: shor... Guilherme Ceschiatti
- URLConnection using the method POST Guilherme Ceschiatti
- Re: URLConnection using the method POST Lorin Kobashigawa
- RE: URLConnection using the method POST Damian Guy
- RE: URLConnection using the method P... Brady Moritz
