ApiController::Content Method

 

Namespace:   System.Web.Http
Assembly:  System.Web.Http (in System.Web.Http.dll)

NameDescription
System_CAPS_protmethodContent<T>(HttpStatusCode, T)

Creates a <see cref="T:System.Web.Http.NegotiatedContentResult`1" /> with the specified values.

System_CAPS_protmethodContent<T>(HttpStatusCode, T, MediaTypeFormatter^)

Creates a <see cref="T:System.Web.Http.FormattedContentResult`1" /> with the specified values.

System_CAPS_protmethodContent<T>(HttpStatusCode, T, MediaTypeFormatter^, MediaTypeHeaderValue^)

Creates a <see cref="T:System.Web.Http.FormattedContentResult`1" /> with the specified values.

System_CAPS_protmethodContent<T>(HttpStatusCode, T, MediaTypeFormatter^, String^)

Creates a <see cref="T:System.Web.Http.FormattedContentResult`1" /> with the specified values.

Return to top

ApiController::Content<T> Method (HttpStatusCode, T)

Creates a <see cref="T:System.Web.Http.NegotiatedContentResult`1" /> with the specified values.

public protected:
generic<typename T>
virtual NegotiatedContentResult<T>^ Content(
	HttpStatusCode statusCode,
	T value
)

Parameters

statusCode
Type: System.Net::HttpStatusCode

The HTTP status code for the response message.

value
Type: T

The content value to negotiate and format in the entity body.

Return Value

Type: System.Web.Http.Results::NegotiatedContentResult<T>^

A <see cref="T:System.Web.Http.NegotiatedContentResult`1" /> with the specified values.

Type Parameters

T

The type of content in the entity body.

Return to top

ApiController::Content<T> Method (HttpStatusCode, T, MediaTypeFormatter^)

Creates a <see cref="T:System.Web.Http.FormattedContentResult`1" /> with the specified values.

public protected:
generic<typename T>
FormattedContentResult<T>^ Content(
	HttpStatusCode statusCode,
	T value,
	MediaTypeFormatter^ formatter
)

Parameters

statusCode
Type: System.Net::HttpStatusCode

The HTTP status code for the response message.

value
Type: T

The content value to format in the entity body.

formatter
Type: System.Net.Http.Formatting::MediaTypeFormatter^

The formatter to use to format the content.

Return Value

Type: System.Web.Http.Results::FormattedContentResult<T>^

A <see cref="T:System.Web.Http.FormattedContentResult`1" /> with the specified values.

Type Parameters

T

The type of content in the entity body.

Return to top

ApiController::Content<T> Method (HttpStatusCode, T, MediaTypeFormatter^, MediaTypeHeaderValue^)

Creates a <see cref="T:System.Web.Http.FormattedContentResult`1" /> with the specified values.

public protected:
generic<typename T>
virtual FormattedContentResult<T>^ Content(
	HttpStatusCode statusCode,
	T value,
	MediaTypeFormatter^ formatter,
	MediaTypeHeaderValue^ mediaType
)

Parameters

statusCode
Type: System.Net::HttpStatusCode

The HTTP status code for the response message.

value
Type: T

The content value to format in the entity body.

formatter
Type: System.Net.Http.Formatting::MediaTypeFormatter^

The formatter to use to format the content.

mediaType
Type: System.Net.Http.Headers::MediaTypeHeaderValue^

The value for the Content-Type header, or <see langword="null" /> to have the formatter pick a default value.

Return Value

Type: System.Web.Http.Results::FormattedContentResult<T>^

A <see cref="T:System.Web.Http.FormattedContentResult`1" /> with the specified values.

Type Parameters

T

The type of content in the entity body.

Return to top

ApiController::Content<T> Method (HttpStatusCode, T, MediaTypeFormatter^, String^)

Creates a <see cref="T:System.Web.Http.FormattedContentResult`1" /> with the specified values.

public protected:
generic<typename T>
FormattedContentResult<T>^ Content(
	HttpStatusCode statusCode,
	T value,
	MediaTypeFormatter^ formatter,
	String^ mediaType
)

Parameters

statusCode
Type: System.Net::HttpStatusCode

The HTTP status code for the response message.

value
Type: T

The content value to format in the entity body.

formatter
Type: System.Net.Http.Formatting::MediaTypeFormatter^

The formatter to use to format the content.

mediaType
Type: System::String^

The value for the Content-Type header.

Return Value

Type: System.Web.Http.Results::FormattedContentResult<T>^

A <see cref="T:System.Web.Http.FormattedContentResult`1" /> with the specified values.

Type Parameters

T

The type of content in the entity body.

Return to top
Show: