FormattedContentResult<T> Constructor
Namespace: System.Web.Http.Results
Assembly: System.Web.Http (in System.Web.Http.dll)
Overload List
Name | Description | |
---|---|---|
FormattedContentResult<T>(HttpStatusCode, T, MediaTypeFormatter, MediaTypeHeaderValue, ApiController) | Initializes a new instance of the FormattedContentResult<T> class with the values provided. |
|
FormattedContentResult<T>(HttpStatusCode, T, MediaTypeFormatter, MediaTypeHeaderValue, HttpRequestMessage) | Initializes a new instance of the FormattedContentResult<T> class with the values provided. |
See Also
FormattedContentResult<T> Class
System.Web.Http.Results Namespace
Return to top
FormattedContentResult<T> Constructor (HttpStatusCode, T, MediaTypeFormatter, MediaTypeHeaderValue, ApiController)
Initializes a new instance of the FormattedContentResult<T> class with the values provided.
Syntax
public FormattedContentResult(
HttpStatusCode statusCode,
T content,
MediaTypeFormatter formatter,
MediaTypeHeaderValue mediaType,
ApiController controller
)
public:
FormattedContentResult(
HttpStatusCode statusCode,
T content,
MediaTypeFormatter^ formatter,
MediaTypeHeaderValue^ mediaType,
ApiController^ controller
)
new :
statusCode:HttpStatusCode *
content:'T *
formatter:MediaTypeFormatter *
mediaType:MediaTypeHeaderValue *
controller:ApiController -> FormattedContentResult
Public Sub New (
statusCode As HttpStatusCode,
content As T,
formatter As MediaTypeFormatter,
mediaType As MediaTypeHeaderValue,
controller As ApiController
)
Parameters
statusCode
Type: System.Net.HttpStatusCodeThe HTTP status code for the response message.
content
Type: TThe content value to format in the entity body.
formatter
Type: System.Net.Http.Formatting.MediaTypeFormatterThe formatter to use to format the content.
mediaType
Type: System.Net.Http.Headers.MediaTypeHeaderValueThe value for the Content-Type header, or null to have the formatter pick a default value.
controller
Type: System.Web.Http.ApiControllerThe controller from which to obtain the dependencies needed for execution.
Return to top
FormattedContentResult<T> Constructor (HttpStatusCode, T, MediaTypeFormatter, MediaTypeHeaderValue, HttpRequestMessage)
Initializes a new instance of the FormattedContentResult<T> class with the values provided.
Syntax
public FormattedContentResult(
HttpStatusCode statusCode,
T content,
MediaTypeFormatter formatter,
MediaTypeHeaderValue mediaType,
HttpRequestMessage request
)
public:
FormattedContentResult(
HttpStatusCode statusCode,
T content,
MediaTypeFormatter^ formatter,
MediaTypeHeaderValue^ mediaType,
HttpRequestMessage^ request
)
new :
statusCode:HttpStatusCode *
content:'T *
formatter:MediaTypeFormatter *
mediaType:MediaTypeHeaderValue *
request:HttpRequestMessage -> FormattedContentResult
Public Sub New (
statusCode As HttpStatusCode,
content As T,
formatter As MediaTypeFormatter,
mediaType As MediaTypeHeaderValue,
request As HttpRequestMessage
)
Parameters
statusCode
Type: System.Net.HttpStatusCodeThe HTTP status code for the response message.
content
Type: TThe content value to format in the entity body.
formatter
Type: System.Net.Http.Formatting.MediaTypeFormatterThe formatter to use to format the content.
mediaType
Type: System.Net.Http.Headers.MediaTypeHeaderValueThe value for the Content-Type header, or null to have the formatter pick a default value.
request
Type: System.Net.Http.HttpRequestMessageThe request message which led to this result.
Return to top