StringOutputFormatter Class

Definition

A TextOutputFormatter for simple text content.

public ref class StringOutputFormatter : Microsoft::AspNetCore::Mvc::Formatters::TextOutputFormatter
public class StringOutputFormatter : Microsoft.AspNetCore.Mvc.Formatters.TextOutputFormatter
type StringOutputFormatter = class
    inherit TextOutputFormatter
Public Class StringOutputFormatter
Inherits TextOutputFormatter
Inheritance

Constructors

StringOutputFormatter()

Creates a new StringOutputFormatter that only supports plain text encoded as UTF8 or Unicode.

Properties

SupportedEncodings

Gets the mutable collection of character encodings supported by this TextOutputFormatter. The encodings are used when writing the data.

(Inherited from TextOutputFormatter)
SupportedMediaTypes

Gets the mutable collection of media type elements supported by this OutputFormatter.

(Inherited from OutputFormatter)

Methods

CanWriteResult(OutputFormatterCanWriteContext)

Verifies that the object to be formatted is a string and proceeds with the standard checks of Microsoft.AspNetCore.Mvc.Formatters.OutputFormatter.CanWriteResult(OutputFormatterCanWriteContext).

CanWriteType(Type)

Returns a value indicating whether or not the given type can be written by this serializer.

(Inherited from OutputFormatter)
GetSupportedContentTypes(String, Type)

Gets a filtered list of content types which are supported by the IOutputFormatter for the objectType and contentType.

(Inherited from OutputFormatter)
SelectCharacterEncoding(OutputFormatterWriteContext)

Determines the best Encoding amongst the supported encodings for reading or writing an HTTP entity body based on the provided content type.

(Inherited from TextOutputFormatter)
WriteAsync(OutputFormatterWriteContext)

Writes the object represented by context's Object property.

(Inherited from TextOutputFormatter)
WriteResponseBodyAsync(OutputFormatterWriteContext, Encoding)

Writes the response body.

WriteResponseBodyAsync(OutputFormatterWriteContext)

Writes the response body.

(Inherited from TextOutputFormatter)
WriteResponseHeaders(OutputFormatterWriteContext)

Sets the headers on HttpResponse object.

(Inherited from OutputFormatter)

Applies to