Org.Apache.Http.IHttpResponse.SetStatusCode Method
Updates the status line of this response with a new status code.

Syntax

[Android.Runtime.Register("setStatusCode", "(I)V", "GetSetStatusCode_IHandler:Org.Apache.Http.IHttpResponseInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")]
public void SetStatusCode (int code)

See Also

HttpStatus
IHttpResponse.StatusLine
IHttpResponse.SetStatusLine(ProtocolVersion, System.Int32)

Parameters

code
the HTTP status code.

Exceptions

TypeReason
Java.Lang.IllegalStateExceptionif the status line has not be set

Remarks

Updates the status line of this response with a new status code. The status line can only be updated if it is available. It must have been set either explicitly or in a constructor.

The reason phrase will be updated according to the new status code, based on the current IHttpResponse.Locale. It can be set explicitly using IHttpResponse.SetReasonPhrase(string).

[Android Documentation]

Requirements

Namespace: Org.Apache.Http
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 1