Refit.ISynchronousContentDeserializer
An optional capability for an IHttpContentSerializer that can deserialize an already-buffered
response body string synchronously. Refit uses this for GetContentAs<T> and
TryGetContentAs<T>, which let callers peek at an error body from inside an
exception filter (catch (ApiException ex) when (ex.TryGetContentAs<Error>(out var error))),
where awaiting is not allowed by the CLR.
namespace Refit
{
public interface ISynchronousContentDeserializer
{
T DeserializeFromString<T>(string content);
}
}