Partager via


HttpEngine.CreateUrlStreamHandlerFactory Method

Definition

Creates a URLStreamHandlerFactory to handle HTTP and HTTPS traffic.

[Android.Runtime.Register("createUrlStreamHandlerFactory", "()Ljava/net/URLStreamHandlerFactory;", "GetCreateUrlStreamHandlerFactoryHandler", ApiSince=34)]
public abstract Java.Net.IURLStreamHandlerFactory CreateUrlStreamHandlerFactory ();
[<Android.Runtime.Register("createUrlStreamHandlerFactory", "()Ljava/net/URLStreamHandlerFactory;", "GetCreateUrlStreamHandlerFactoryHandler", ApiSince=34)>]
abstract member CreateUrlStreamHandlerFactory : unit -> Java.Net.IURLStreamHandlerFactory

Returns

an URLStreamHandlerFactory instance implemented by this HttpEngine.

Attributes

Remarks

Creates a URLStreamHandlerFactory to handle HTTP and HTTPS traffic. An instance of this class can be installed via URL#setURLStreamHandlerFactory thus using this HttpEngine by default for all requests created via URL#openConnection.

This java.net.HttpURLConnection implementation does not implement all features offered by the API: <ul> <li>the HTTP cache installed via HttpResponseCache#install(java.io.File, long) HttpResponseCache.install()</li> <li>the HTTP authentication method installed via java.net.Authenticator#setDefault</li> <li>the HTTP cookie storage installed via java.net.CookieHandler#setDefault</li> </ul>

While we support and encourages requests using the HTTPS protocol, we don't provide support for the HttpsURLConnection API. This lack of support also includes not using certain HTTPS features provided via HttpsURLConnection: <ul> <li>the HTTPS hostname verifier installed via HttpsURLConnection#setDefaultHostnameVerifier(javax.net.ssl.HostnameVerifier) HttpsURLConnection.setDefaultHostnameVerifier()</li> <li>the HTTPS socket factory installed via HttpsURLConnection#setDefaultSSLSocketFactory(javax.net.ssl.SSLSocketFactory) HttpsURLConnection.setDefaultSSLSocketFactory()</li> </ul>

Java documentation for android.net.http.HttpEngine.createUrlStreamHandlerFactory().

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