Freigeben über


HttpURLConnection.ErrorStream Property

Definition

Returns the error stream if the connection failed but the server sent useful data nonetheless.

public virtual System.IO.Stream? ErrorStream { [Android.Runtime.Register("getErrorStream", "()Ljava/io/InputStream;", "GetGetErrorStreamHandler")] get; }
[<get: Android.Runtime.Register("getErrorStream", "()Ljava/io/InputStream;", "GetGetErrorStreamHandler")>]
member this.ErrorStream : System.IO.Stream

Property Value

an error stream if any, null if there have been no errors, the connection is not connected or the server sent no useful data.

Attributes

Remarks

Returns the error stream if the connection failed but the server sent useful data nonetheless. The typical example is when an HTTP server responds with a 404, which will cause a FileNotFoundException to be thrown in connect, but the server sent an HTML help page with suggestions as to what to do.

This method will not cause a connection to be initiated. If the connection was not connected, or if the server did not have an error while connecting or if the server had an error but no error data was sent, this method will return null. This is the default.

Java documentation for java.net.HttpURLConnection.getErrorStream().

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