Given the following code:
private HttpsURLConnection buildConnection(final String urlString) throws MalformedURLException,
IOException, ProtocolException {
final URL url = new URL(urlString);
final HttpsURLConnection connection = (HttpsURLConnection) url.openConnection();
connection.setRequestMethod("POST");
connection.setUseCaches(false);
connection.setDoInput(true);
connection.setDoOutput(true);
connection.setChunkedStreamingMode(0);
return connection;
}
Why does connection.method = "GET"? Any calls to addRequestProperty also seems to be ignored, as well.
This is using Android, Android Studio, on Windows to write the code (thus using whatever classes it downloads with the Android SDK, which should be the same as anyone else...)