Java.Net.URLConnection.AddRequestProperty Method
Adds the given property to the request header.

Syntax

[Android.Runtime.Register("addRequestProperty", "(Ljava/lang/String;Ljava/lang/String;)V", "GetAddRequestProperty_Ljava_lang_String_Ljava_lang_String_Handler")]
public virtual void AddRequestProperty (string field, string newValue)

Parameters

field
the request property field name to add.
newValue
the value of the property which is to add.

Exceptions

TypeReason
Java.Lang.IllegalStateExceptionif the connection has been already established.
Java.Lang.NullPointerExceptionif the property name is null.

Remarks

Adds the given property to the request header. Existing properties with the same name will not be overwritten by this method.

[Android Documentation]

Requirements

Namespace: Java.Net
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 1