Android httpurlconnection无法发布bigsize json数据

Android httpurlconnection无法发布bigsize json数据,android,json,Android,Json,在我的Android项目中,我想发布bigsize json数据。因此,我使用了 String url1 = localhost://8080/myproject/sendData; // initialize URL URL url = new URL(url1); String urlParameters = "myobject=" + URLEncoder.encode(jsonobject, "UTF-8"); // instantiate a HttpURLConnec

在我的Android项目中,我想发布bigsize json数据。因此,我使用了

String url1 = localhost://8080/myproject/sendData;
// initialize URL
URL url = new URL(url1);
String urlParameters = "myobject="
        + URLEncoder.encode(jsonobject, "UTF-8");
// instantiate a HttpURLConnection
HttpsURLConnection conn = (HttpsURLConnection) url.openConnection();
conn.setDoOutput(true);
// sending data as POST
conn.setRequestMethod("POST");
// set the length of the files
conn.setFixedLengthStreamingMode(urlParameters.getBytes().length);
// set headers
conn.setRequestProperty("Content-Type",
        "application/x-www-form-urlencoded");
conn.setRequestProperty("My-Id", Id);
conn.setDoInput(true);

PrintWriter out = new PrintWriter(conn.getOutputStream());
out.print(urlParameters);
out.close();

在这段代码中,urlParameters我正在发送json数据。但问题是,如果json数据很小,那么它就可以工作。但是大尺寸的json数据不工作。为什么???

它永远不会像
字符串url1=localhost://8080/myproject/sendData;没有有效的url。是否小?大的多少字节?请定义“不工作”。