HttpURLConnection doing a get request even after setDoOutput(true), setRequestMethod(“POST”) setRequestProperty("Content
问题 Here is the code: String Surl = "http://mysite.com/somefile"; String charset = "UTF-8"; query = String.format("param1=%s¶m2=%s", URLEncoder.encode("param1", charset), URLEncoder.encode("param2", charset)); HttpURLConnection urlConnection = (HttpURLConnection) new URL(Surl + "?" + query).openConnection(); urlConnection.setRequestMethod("POST"); urlConnection.setDoOutput(true); urlConnection.setUseCaches(false); urlConnection.setAllowUserInteraction(false); urlConnection.setRequestProperty(