public class UrlConnect {
public static void main(String[] args) throws Exception {
String s = UrlConnect.urlConnectXml("http://localhost:8080/user/list", "{\"id\":\"1\"}");
System.out.println(s);
}
public static String urlConnectXml(String urlStr,String jsonString) throws Exception {
URL url = new URL(urlStr);
HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection
HttpURLConnection请求获取数据。
最新推荐文章于 2021-03-24 11:19:29 发布