title: Getting an "Unsupported media type-415" on an ajax call- Jquery,ajax
body: <p>I'm calling an ajax function to update a certain record and I'm getting a 415-Unsupported Media type. Below is the js:</p>
  
  <pre><code>$("#update").on("click", function(){
      event.preventDefault();
          return $.ajax('/update/record',{
              method: 'PUT',
              data:{
                  date: date
              },
             success: function(){
                alert("record updated successfully");
             }
  
          });
  </code></pre>
  
  <p>html:</p>
  
  <pre><code>&lt;form&gt;
      &lt;button type="submit" id="update-cc"&gt;Update&lt;/button&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>I don't know what I'm doing wrong here or what I need to add to get the correct form of the ajax call.Any ideas????</p>
  
  <p>Thanks!</p>