URLConnection.GetHeaderFieldInt(String, Int32) Method

Definition

Returns the value of the named field parsed as a number.

[Android.Runtime.Register("getHeaderFieldInt", "(Ljava/lang/String;I)I", "GetGetHeaderFieldInt_Ljava_lang_String_IHandler")]
public virtual int GetHeaderFieldInt (string? name, int Default);
[<Android.Runtime.Register("getHeaderFieldInt", "(Ljava/lang/String;I)I", "GetGetHeaderFieldInt_Ljava_lang_String_IHandler")>]
abstract member GetHeaderFieldInt : string * int -> int
override this.GetHeaderFieldInt : string * int -> int

Parameters

name
String

the name of the header field.

Default
Int32

the default value.

Returns

the value of the named field, parsed as an integer. The Default value is returned if the field is missing or malformed.

Attributes

Remarks

Returns the value of the named field parsed as a number.

This form of getHeaderField exists because some connection types (e.g., http-ng) have pre-parsed headers. Classes for that connection type can override this method and short-circuit the parsing.

Java documentation for java.net.URLConnection.getHeaderFieldInt(java.lang.String, int).

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