private static void post() throws IOException{ URL url = new URL(" ");// 提交地址 HttpURLConnection httpURLConnection = (HttpURLConnection) url.openConnection(); httpURLConnection.setDoOutput(true);// 打开写入属性 httpURLConnection.setDoInput(true);// 打开读取属性 httpURLConnection.setRequestMethod("POST");// 设置提交方法 httpURLConnection.setRequestProperty("Content-Type","text/xml;charset=UTF-8");// /getWeatherbyCityName"); httpURLConnection.setRequestProperty("User-Agent", "Jakarta Commons-HttpClient/3.1"); httpURLConnection.setConnectTimeout(50000);// 连接超时时间 httpURLConnection.setReadTimeout(50000); httpURLConnection.connect(); BufferedWriter out = new BufferedWriter(new OutputStreamWriter(httpURLConnection.getOutputStream())); out.write("name=1&pwd=2"); out.flush(); out.close(); //读取post之后的返回值 BufferedReader in = new BufferedReader(new InputStreamReader((InputStream) httpURLConnection.getInputStream(),"UTF-8")); String line = null; StringBuilder sb = new StringBuilder(); while ((line = in.readLine()) != null) { sb.append(line); } in.close(); System.out.println("client:" + sb.toString()); httpURLConnection.disconnect();//断开连接 }
不行 贴出你的联系方式
近日CloudCone发布了最新的补货消息,针对此前新年闪购年付便宜VPS云服务器计划方案进行了少量补货,KVM虚拟架构,美国洛杉矶CN2 GT线路,1Gbps带宽,最低3TB流量,仅需14美元/年,有需要国外便宜美国洛杉矶VPS云服务器的朋友可以尝试一下。CloudCone怎么样?CloudCone服务器好不好?CloudCone值不值得购买?CloudCone是一家成立于2017年的美国服务器...
酷锐云是一家2019年开业的国人主机商家,商家为企业运营,主要销售主VPS服务器,提供挂机宝和云服务器,机房有美国CERA、中国香港安畅和电信,CERA为CN2 GIA线路,提供单机10G+天机盾防御,提供美国原生IP,支持媒体流解锁,商家的套餐价格非常美丽,CERA机房月付20元起,香港安畅机房10M带宽月付25元,有需要的朋友可以入手试试。酷锐云自开业以来一直有着良好的产品稳定性及服务态度,支...
Megalayer 商家算是新晋的服务商,商家才开始的时候主要是以香港、美国独立服务器。后来有新增菲律宾机房,包括有VPS云服务器、独立服务器、站群服务器等产品。线路上有CN2优化带宽、全向带宽和国际带宽,这里有看到商家的特价方案有增加至9个,之前是四个的。在这篇文章中,我来整理看看。第一、香港服务器系列这里香港服务器会根据带宽的不同区别。我这里将香港机房的都整理到一个系列里。核心内存硬盘IP带宽...