6.8Built-in Content Converters
StringContentConvertercontent converter
When the target receiving type is a string, StringContentConverter is used to convert the HttpResponseMessage object into a string. Internally, this conversion calls the ReadAsStringAsync method provided by HttpResponseMessage.Content.
StreamContentConvertercontent converter
When the target receiving type is Stream, StreamContentConverter is used to convert the HttpResponseMessage object into a Stream. Internally, this conversion calls the ReadAsStreamAsync method provided by HttpResponseMessage.Content.
ByteArrayContentConvertercontent converter
When the target receiving type is a byte array, ByteArrayContentConverter is used to convert the HttpResponseMessage object into a byte array. Internally, this conversion calls the ReadAsByteArrayAsync method provided by HttpResponseMessage.Content.
HttpResponseMessageConvertercontent converter
When the target receiving type is HttpResponseMessage, HttpResponseMessageConverter is used to return the HttpResponseMessage object directly.
VoidContentConvertercontent converter
When the target receiving type is void or VoidContent, VoidContentConverter is used to return a null value (no return value).
IActionResultContentConvertercontent converter
When the target receiving type is IActionResult, IActionResultContentConverter is used to convert the HttpResponseMessage object into IActionResultContentConverter.
AsyncEnumerableContentConverter<T>content converter
When the target receiving type is IAsyncEnumerable<T>, AsyncEnumerableContentConverter<T> is used to convert the HttpResponseMessage object into IAsyncEnumerable<T>. Internally, this conversion calls the ReadFromJsonAsAsyncEnumerable method provided by HttpResponseMessage.Content.
HttpRemoteResult<T>content converter
When the target receiving type is HttpRemoteResult<T>, HttpRemoteResultContentConverter<T> is used to convert the HttpResponseMessage object into HttpRemoteResult<T>. Internally, this conversion calls the ReadAsync method provided by IHttpContentConverterFactory.
ObjectContentConvertercontent converter
When the target receiving type is not a specific type — for example custom types, primitive data types (such as int, bool, and so on), and various other types — ObjectContentConverter is used to convert the HttpResponseMessage object into the target receiving type. Internally, this conversion calls the ReadFromJsonAsync method provided by HttpResponseMessage.Content.