Share via


Network.OpenConnection Method

Definition

Overloads

OpenConnection(URL)

Opens the specified URL on this Network, such that all traffic will be sent on this Network.

OpenConnection(URL, Proxy)

Opens the specified URL on this Network, such that all traffic will be sent on this Network.

OpenConnection(URL)

Opens the specified URL on this Network, such that all traffic will be sent on this Network.

[Android.Runtime.Register("openConnection", "(Ljava/net/URL;)Ljava/net/URLConnection;", "GetOpenConnection_Ljava_net_URL_Handler")]
public virtual Java.Net.URLConnection? OpenConnection (Java.Net.URL? url);
[<Android.Runtime.Register("openConnection", "(Ljava/net/URL;)Ljava/net/URLConnection;", "GetOpenConnection_Ljava_net_URL_Handler")>]
abstract member OpenConnection : Java.Net.URL -> Java.Net.URLConnection
override this.OpenConnection : Java.Net.URL -> Java.Net.URLConnection

Parameters

url
URL

Returns

a URLConnection to the resource referred to by this URL.

Attributes

Exceptions

if the URL protocol is not HTTP or HTTPS.

if an error occurs while opening the connection.

Remarks

Opens the specified URL on this Network, such that all traffic will be sent on this Network. The URL protocol must be HTTP or HTTPS.

Java documentation for android.net.Network.openConnection(java.net.URL).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

See also

Applies to

OpenConnection(URL, Proxy)

Opens the specified URL on this Network, such that all traffic will be sent on this Network.

[Android.Runtime.Register("openConnection", "(Ljava/net/URL;Ljava/net/Proxy;)Ljava/net/URLConnection;", "GetOpenConnection_Ljava_net_URL_Ljava_net_Proxy_Handler", ApiSince=23)]
public virtual Java.Net.URLConnection? OpenConnection (Java.Net.URL? url, Java.Net.Proxy? proxy);
[<Android.Runtime.Register("openConnection", "(Ljava/net/URL;Ljava/net/Proxy;)Ljava/net/URLConnection;", "GetOpenConnection_Ljava_net_URL_Ljava_net_Proxy_Handler", ApiSince=23)>]
abstract member OpenConnection : Java.Net.URL * Java.Net.Proxy -> Java.Net.URLConnection
override this.OpenConnection : Java.Net.URL * Java.Net.Proxy -> Java.Net.URLConnection

Parameters

url
URL
proxy
Proxy

the proxy through which the connection will be established.

Returns

a URLConnection to the resource referred to by this URL.

Attributes

Remarks

Opens the specified URL on this Network, such that all traffic will be sent on this Network. The URL protocol must be HTTP or HTTPS.

Java documentation for android.net.Network.openConnection(java.net.URL, java.net.Proxy).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to