title: unsupported media type web api post
body: <p>i am using angularjs to post the data created webapi. its working on my local system, but when i uploaded on server its not working and returning error, unsupported media type. please help me how to fix this.</p>
  
  <pre><code>&lt;script&gt;
  var app = angular.module('MyApp', []);
  
  app.controller("QueryControllerController", function ($scope, $http) {
  
      $scope.submit = function () {
          if ($scope.QueryDescription) {
              var product = {
                  "QueryDescription": $scope.QueryDescription,
                  "CategoryID": $scope.CategoryID
  
              }
              $http.post('/api/querycontroller', JSON.stringify(product)).
              success(function (data, status, headers, config) {
                  alert('Added Successfully' + headers);
                  $('#formusers')[0].reset();
              }).
              error(function (data, status, headers, config) {
                  alert(status + ", " + data + ", " + headers + "," + config);
              });
          }
      };
  
  }
  );
  </code></pre>
  
  <p></p>
  
  <p>my api controller code is :</p>
  
  <pre><code>[ResponseType(typeof(Query))]
  
      [HttpPost]
      public HttpResponseMessage Post([FromBody]Query Services)
      {
  
          Services.CommunityID = UserStatus.GetUserID(User.Identity.Name);
          Services = repository.Add(Services);
          var response = Request.CreateResponse&lt;Query&gt;(HttpStatusCode.Created, Services);
          string uri = Url.Route(null, new { id = Services.QueryID });
          response.Headers.Location = new Uri(Request.RequestUri, uri);
  
          return response;
  
      }
  </code></pre>
  
  <p>When I try to post, I get Unsupported Media Type response.:</p>
  
  <pre><code>  "Message": "The request entity's media type 'text/plain' is not supported   for this resource."
  </code></pre>