title: The request entity's media type 'application/xml' is not supported for this resource
body: <p>I am trying to pass XLIFF content in the parameter of following function, I am getting error:</p>
  
  <pre><code>public IHttpActionResult ProcessSmartlingTranslation([FromBody]xliff xliff)
         {
             return Content(HttpStatusCode.BadRequest, "Any object");
         }
  </code></pre>
  
  <blockquote>
    <p>{  "message": "The request entity's media type 'application/xml' is
    not supported for this resource.",  "exceptionMessage": "No
    MediaTypeFormatter is available to read an object of type 'xliff' from
    content with media type 'application/xml'.",  "exceptionType":
    "System.Net.Http.UnsupportedMediaTypeException",  "stackTrace": "   at
    System.Net.Http.HttpContentExtensions.ReadAsAsync[T](HttpContent
    content, Type type, IEnumerable<code>1 formatters, IFormatterLogger
    formatterLogger, CancellationToken cancellationToken)\r\n   at
    System.Net.Http.HttpContentExtensions.ReadAsAsync(HttpContent content,
    Type type, IEnumerable</code>1 formatters, IFormatterLogger formatterLogger,
    CancellationToken cancellationToken)\r\n   at
    System.Web.Http.ModelBinding.FormatterParameterBinding.ReadContentAsync(HttpRequestMessage
    request, Type type, IEnumerable`1 formatters, IFormatterLogger
    formatterLogger, CancellationToken cancellationToken)" }</p>
  </blockquote>
  
  <p>How would i solve the issue?</p>
  
  <p>Complete code is below:</p>
  
  <pre><code>// &lt;summary&gt;
     /// XliffModel created
     /// &lt;/summary&gt;
     public class xliff
     {
         /// &lt;summary&gt;
         /// file getter setter method
         /// &lt;/summary&gt;
         public string file { get; set; }
         /// &lt;summary&gt;
         /// body getter setter method
         /// &lt;/summary&gt;
         public string body { get; set; }
     }
     /// &lt;summary&gt;
     /// Web api for smartling translation processing
     /// &lt;/summary&gt;
     /// &lt;seealso cref="ApiController" /&gt;
     public class SmartlingController : ApiController
     {
         #region Public Methods
  
         /// &lt;summary&gt;
         /// Get or insert blog comments which is approved based on blogs
         /// &lt;/summary&gt;
         /// &lt;remarks&gt; Get or insert blog comments which is approved based on blogs&lt;/remarks&gt;
         /// &lt;param name="message"&gt;The comment.&lt;/param&gt;
         /// &lt;response code="200"&gt;Get approved blog comments&lt;/response&gt;
         /// &lt;response code="404"&gt;Not found&lt;/response&gt;
         /// &lt;returns&gt;IHttpActionResult&lt;/returns&gt;
         [Route("api/smartling/ProcessSmartlingTranslation")]
         [VersionedRoute("", 1)]
         [ResponseType(typeof(HttpResponseMessage))]
         [HttpPost]
         public IHttpActionResult ProcessSmartlingTranslation([FromBody]xliff xlf)
         {
             return Content(HttpStatusCode.BadRequest, "Any object");
         }
         #endregion
     }
  </code></pre>