DurableHttpResponse
record
Namespace: Orleans.Durable.Http
Records an HTTP response which a durable task received: its status code, headers, and content.
[Orleans.GenerateSerializer][Orleans.Immutable][Orleans.Alias(Orleans.Durable.Http.DurableHttpResponse)]public record DurableHttpResponse : IEquatable<DurableHttpResponse>Remarks
The task records the response, so replays read it without sending the request again. It suits API responses, up to
DurableHttpClientOptions; stream large content within a step of the task instead. The record omits Set-Cookie headers, which carry the server's credentials for the client. Constructors
DurableHttpResponse(HttpStatusCode, Uri?, IReadOnlyDictionary<string, string[]>, ReadOnlyMemory<byte>)Records an HTTP response which a durable task received: its status code, headers, and content.
Properties
ContentThe response's content.HeadersThe response's headers and content headers, whose names compare case-insensitively.IsSuccessStatusCodeGets whetherDurableHttpResponseis in the range 200-299.RequestUriThe URL of the request which the response answers.StatusCodeThe response's status code.
Methods
EnsureSuccessStatusCodeThrows anSystem.Net.Http.HttpRequestExceptionwhenDurableHttpResponseisfalse.GetHeader(string)Returns the first value of the headername, ornullwhen the response doesn't have it.ReadAsStringReturns the content decoded as UTF-8 text.ReadFromJson(JsonSerializerOptions?)Deserializes the content as JSON, or returnsdefaultfor empty content.
