Share via


URLConnection.AddRequestProperty(String, String) Method

Definition

Adds a general request property specified by a key-value pair.

[Android.Runtime.Register("addRequestProperty", "(Ljava/lang/String;Ljava/lang/String;)V", "GetAddRequestProperty_Ljava_lang_String_Ljava_lang_String_Handler")]
public virtual void AddRequestProperty (string? key, string? value);
[<Android.Runtime.Register("addRequestProperty", "(Ljava/lang/String;Ljava/lang/String;)V", "GetAddRequestProperty_Ljava_lang_String_Ljava_lang_String_Handler")>]
abstract member AddRequestProperty : string * string -> unit
override this.AddRequestProperty : string * string -> unit

Parameters

key
String

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

value
String

the value associated with it.

Attributes

Exceptions

if the connection has been already established.

if the property name is null.

Remarks

Adds a general request property specified by a key-value pair. This method will not overwrite existing values associated with the same key.

Added in 1.4.

Java documentation for java.net.URLConnection.addRequestProperty(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