title: Post function error: An entry without a type name was found
body: <p>I have an ajax call error 400 when trying to post data to a sharepoint list.</p>
  
  <p>Exception is Microsoft.SharePoint.Client.InvalidClientQueryException and message is "An entry without a type name was found, but no expected type was specified. To allow entries without type information, the expected type must also be specified when the model is specified."</p>
  
  <p>My code..</p>
  
  <pre><code>//Get form digest value
              function getFormDigest(webUrl) {
                  return $.ajax({
                      url: webUrl + "/_api/contextinfo",
                      method: "POST",
                      headers: { "Accept": "application/json; odata=verbose" }
                  });
              }
  
  
  
              //Create list item to add to sharepoint list
              function createListItem(webUrl, listName, itemProperties) {
                  return getFormDigest(webUrl).then(function (data) {
  
                      return $.ajax({
                          url: webUrl + "/_api/web/lists/getbytitle('" + listName + "')/items",
                          type: "POST",
                          processData: false,
                          data: JSON.stringify(itemProperties),
                          headers: {
                              "Accept": "application/json;odata=verbose",
                              "X-RequestDigest": data.d.GetContextWebInformation.FormDigestValue,
                              "Content-Type": "application/json;odata=verbose",
                              "X-HTTP-Method": "POST"
                          }
                      });
                  });
              }
  
              //Getting the item type of a list
              function GetItemTypeForListName(name) {
                  return "SP.Data." + name.charAt(0).toUpperCase() + name.split(" ").join("").slice(1) + "ListItem";
              }
  
  
              //On button click
              $("#btn_post").click(function () {
  
                  //Item properties
                  var itemProperties = {
                      _metadata: { "type": GetItemTypeForListName("EmployeeBirthdayWishes") },
                      Title: $("#title").val(),
                      Wish: $("#birthday_wish").val(),
                      FullNames: $("#fullNames").val()
                  };
  
                  //Function call to create a list item
                  createListItem(_spPageContextInfo.webAbsoluteUrl, "EmployeeBirthdayWishes", itemProperties)
                      .done(function (data) {
                          console.log(data);
                          console.log("Task has been created successfully");
                      }).fail(function (error) {
                          console.log(JSON.stringify(error));
                          alert(JSON.stringify(error));
  
                      });
              });
  </code></pre>