URLConnection.SetDefaultRequestProperty(String, String) Method

Definition

Caution

deprecated

Sets the default value of a general request property.

[Android.Runtime.Register("setDefaultRequestProperty", "(Ljava/lang/String;Ljava/lang/String;)V", "")]
[System.Obsolete("deprecated")]
public static void SetDefaultRequestProperty (string? key, string? value);
[<Android.Runtime.Register("setDefaultRequestProperty", "(Ljava/lang/String;Ljava/lang/String;)V", "")>]
[<System.Obsolete("deprecated")>]
static member SetDefaultRequestProperty : string * string -> unit

Parameters

key
String

the keyword by which the request is known (e.g., "Accept").

value
String

the value associated with the key.

Attributes

Remarks

Sets the default value of a general request property. When a URLConnection is created, it is initialized with these properties.

This member is deprecated. The instance specific setRequestProperty method should be used after an appropriate instance of URLConnection is obtained. Invoking this method will have no effect.

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

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