Table of Contents

Class OutgoingResponse

Namespace
IceRpc
Assembly
IceRpc.dll

Represents a response frame sent by the application.

public sealed class OutgoingResponse : OutgoingFrame
Inheritance
OutgoingResponse
Inherited Members

Constructors

OutgoingResponse(IncomingRequest)

Constructs an outgoing response with the Ok status code and a null error message.

public OutgoingResponse(IncomingRequest request)

Parameters

request IncomingRequest

The incoming request.

Remarks

The constructor also associates this response with the request. If another response is already set on the request, its payload and payload continuation are completed.

OutgoingResponse(IncomingRequest, StatusCode, string?, Exception?)

Constructs an outgoing response.

public OutgoingResponse(IncomingRequest request, StatusCode statusCode, string? message = null, Exception? exception = null)

Parameters

request IncomingRequest

The incoming request.

statusCode StatusCode

The status code. It must be greater than Ok.

message string

The error message or null to use the default error message.

exception Exception

The exception that is the cause of this failure.

Remarks

The constructor also associates this response with the request. If another response is already set on the request, its payload and payload continuation are completed.

Properties

ErrorMessage

Gets the error message of this response.

public string? ErrorMessage { get; }

Property Value

string

The error message of this response if StatusCode is different from Ok; otherwise, null.

Fields

Gets or sets the fields of this response.

public IDictionary<ResponseFieldKey, OutgoingFieldValue> Fields { get; set; }

Property Value

IDictionary<ResponseFieldKey, OutgoingFieldValue>

The fields of this incoming response. Defaults to Empty.

StatusCode

Gets the status code of this response.

public StatusCode StatusCode { get; }

Property Value

StatusCode

The StatusCode of this response.