import java.net.*;public class HTTPDemo{ public static void main(String[] args){ URL url = new URL("http://xxx"); HttpURLConnection conn = (HttpURLConnection)url.openConnection(); conn.addMethod("post"); conn.setOutxxx;//之类的,请查看api相关方法吧 }}