URL url = new URL("http://www.example.com/comment");
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
connection.setDoOutput(true);
connection.setRequestMethod("POST");
Èconnection.setRequestProperty e scrittura esplicita sull'urloutputstream sono gli stessi?
connection.setRequestProperty(key, value);
lo stesso
OutputStreamWriter writer = new OutputStreamWriter(connection.getOutputStream());
writer.write("key=" + value);
writer.close();
?
In caso contrario, correggimi.