Android URLConnection.setRequestProperty () in Android studio is not like anything

I looked at the source code for URLConnection.setRequestProperty()in android studio and it looks like it is not installing anything:

public void setRequestProperty(String field, String newValue) {
        checkNotConnected();
        if (field == null) {
            throw new NullPointerException("field == null");
        }
    }

and here checkNotConnected ():

private void checkNotConnected() {
        if (connected) {
            throw new IllegalStateException("Already connected");
        }
    }

What am I missing here? HttpURLConnectionan "expanding class" has no implementation setRequestProperty(), so it seems that this method does absolutely nothing.

+4
source share
1 answer

URLConnection is an abstract base class that does not implement any specific protocols.

HttpURLConnection. URLConnection setRequestProperty() HTTP.

, HttpURLConnection . Android Studio , Go To β†’ Implementation (s).

, , SDK, . Java (rt.jar).

, setRequestProperty() SDK.

0

All Articles