6.2Built-in Content Processors
StringContentProcessorContent Processor
When the raw request content satisfies the following conditions, StringContentProcessor is used to build a StringContent instance:
- The raw request content is
StringContentorJsonContent. - The content type includes
application/json,application/json-patch+json,application/xml,application/xml-patch+xml,text/xml,text/html,text/plain, andapplication/soap+xml, and it still applies even when acharsetcharacter set is appended to these types (for exampleapplication/json; charset=utf-8).
StreamContentProcessorContent Processor
When the raw request content satisfies the following conditions, StreamContentProcessor is used to build a StreamContent instance:
- The raw request content is
StreamContentorStream.
ByteArrayContentProcessorContent Processor
When the raw request content satisfies the following conditions, ByteArrayContentProcessor is used to build a ByteArrayContent instance:
- The raw request content is
ByteArrayContentorbyte[], and is notFormUrlEncodedContentorStringContent.
FormUrlEncodedContentProcessorContent Processor
When the raw request content satisfies the following conditions, FormUrlEncodedContentProcessor is used to build a FormUrlEncodedContent instance:
- The raw request content is
FormUrlEncodedContentor a URL-encoded string. - The content type is
application/x-www-form-urlencoded, and it still applies even when acharsetcharacter set is appended to the type (for exampleapplication/x-www-form-urlencoded; charset=utf-8).
StringContentForFormUrlEncodedContentProcessorContent Processor
When the raw request content satisfies the following conditions, StringContentForFormUrlEncodedContentProcessor is used to build a StringContent instance with content type application/x-www-form-urlencoded:
- The raw request content is
FormUrlEncodedContentor a URL-encoded string. - The content type is
application/x-www-form-urlencoded, and it still applies even when acharsetcharacter set is appended to the type (for exampleapplication/x-www-form-urlencoded; charset=utf-8). - The
useStringContentparameter or theUseStringContentproperty istrue.
StringContentForFormUrlEncodedContentProcessor derives from FormUrlEncodedContentProcessor.
ReadOnlyMemoryContentProcessorContent Processor
When the raw request content satisfies the following conditions, ReadOnlyMemoryContentProcessor is used to build a ReadOnlyMemoryContent instance:
- The raw request content is
ReadOnlyMemoryContentorReadOnlyMemory<byte>.
MultipartFormDataContentProcessorContent Processor
When the raw request content satisfies the following conditions, MultipartFormDataContentProcessor is used to build a MultipartFormDataContent instance:
- The raw request content is
MultipartFormDataContent. - The content type is
multipart/form-data, and it still applies even when acharsetcharacter set is appended to the type (for examplemultipart/form-data; charset=utf-8).
MessagePackContentProcessorContent Processor
When the raw request content satisfies the following conditions, MessagePackContentProcessor is used to build a ByteArrayContent instance:
- The content type is
application/msgpack, and it still applies even when acharsetcharacter set is appended to the type (for exampleapplication/msgpack; charset=utf-8).
JsonLinesContentProcessorContent Processor
When the raw request content satisfies the following conditions, JsonLinesContentProcessor is used to build a StringContent instance:
-
The content type includes
application/x-ndjson,application/x-jsonlines,application/jsonlines, andapplication/jsonl, and it still applies even when acharsetcharacter set is appended to the type (for exampleapplication/x-ndjson; charset=utf-8). -
FileInfoContentProcessorContent Processor
When the raw request content satisfies the following conditions, FileInfoContentProcessor is used to build a StreamContent instance:
- The raw request content is
FileInfo.
FormFileContentProcessorContent Processor
When the raw request content satisfies the following conditions, FormFileContentProcessor is used to build a StreamContent instance:
- The raw request content is
IFormFile.