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)
public OutgoingResponse(IncomingRequest request)
Parameters
request
IncomingRequestThe 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
IncomingRequestThe incoming request.
statusCode
StatusCodeThe status code. It must be greater than Ok.
message
stringThe error message or null to use the default error message.
exception
ExceptionThe 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.