0
我使用HTTPUrlConnection與GET方法從服務器獲取數據,並返回字符串大約13k字符,但我只接收1228個字符。如何超過get方法返回字符串(httpurlconnection)
任何超過接收所有字符的解決方案?
這是我的代碼:
URL con = new URL(url);
HttpURLConnection httpURLCon = (HttpURLConnection)con.openConnection();
DataInputStream inStream = new DataInputStream(httpURLCon.getInputStream());
Scanner sc = new Scanner(inStream);
String response = sc.next();
System.out.prinlnt(response.length());
如何向我們展示您在做什麼?對GET請求的HTTP響應不是(或不應該)在長度上受到限制。 – 2011-05-19 16:23:28
代碼請.... – 2011-05-19 16:23:30
可能相關:[HTTP URI GET限制](http://stackoverflow.com/questions/266322/http-uri-get-limit) – MarcoS 2011-05-19 16:25:52