Java.Net.URLConnection.SetRequestProperty Method
Sets the value of the specified request header field.

Syntax

[Android.Runtime.Register("setRequestProperty", "(Ljava/lang/String;Ljava/lang/String;)V", "GetSetRequestProperty_Ljava_lang_String_Ljava_lang_String_Handler")]
public virtual void SetRequestProperty (string field, string newValue)

Parameters

field
the request header field to be set.
newValue
the new value of the specified property.

Exceptions

TypeReason
Java.Lang.IllegalStateExceptionif the connection has been already established.
Java.Lang.NullPointerExceptionif the parameter field is null.

Remarks

Sets the value of the specified request header field. The value will only be used by the current URLConnection instance. This method can only be called before the connection is established.

[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