/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package javaapplication3;

 
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;
import java.net.URLEncoder;

public class HttpPostForm {
      public static void main(String[] args) throws MalformedURLException, IOException
  {
      try {
    // Construct data
    String data = URLEncoder.encode("comment", "UTF-8") + "=" + URLEncoder.encode("value1", "UTF-8");

    // Send data
    URL url = new URL("https://2...content-available-to-author-only...h.hk/pr/res/668341.html");
    URLConnection conn = url.openConnection();
    conn.setDoOutput(true);
    OutputStreamWriter wr = new OutputStreamWriter(conn.getOutputStream());
    wr.write(data);
    wr.flush();

    // Get the response
    BufferedReader rd = new BufferedReader(new InputStreamReader(conn.getInputStream()));
    String line;
    
    while ((line = rd.readLine()) != null) {
       System.out.println(line);
    }
    
    wr.close();
    rd.close();
} catch (Exception e) {
    
}
  }
}
