I looked at the source code for URLConnection.setRequestProperty()
in android studio, and it doesn't seem like it sets anything:
public void setRequestProperty(String field, String newValue) {
checkNotConnected();
if (field == null) {
throw new NullPointerException("field == null");
}
}
and here is checkNotConnected():
private void checkNotConnected() {
if (connected) {
throw new IllegalStateException("Already connected");
}
}
What am I missing here? HttpURLConnection
"the extending class" has no implementation of setRequestProperty()
, so it seems like this method does absolutely nothing.