title: 405 Message, method not allowed with Web Api
body: <p>I have got the following on an API controller:</p>
  
  <pre><code>public void UpdateClient(Client client)
      {
          try
          {
              if (ModelState.IsValid)
              {
                  db.Entry(client).State = EntityState.Modified;
                  db.SaveChanges();
              }
          }
          catch
          {
              throw new HttpResponseException(new HttpResponseMessage(HttpStatusCode.NotFound));
          }
      }
  </code></pre>
  
  <p>And the following on the page:</p>
  
  <pre><code>$.ajax({
              url: "api/client/UpdateClient",
              type: "PUT",
              contentType: 'json',
              data: ko.toJSON(model.selectedClient()),
              success: function (result) {
                  getClients();
                  $("#loader").hide();
              },
              failure: function (result) {
                  alert(result.d);
                  $("#loader").hide();
              },
              error: function (XMLHttpRequest, textStatus, errorThrown) {
                  alert("An error occurred, please try again.");
                  $("#loader").hide();
              }
          });
  </code></pre>
  
  <p>But this gives the error 405 Method Not Allowed, can anyone see where I may have gone wrong?  For reference the url for the api is ok as I use the same api controller for other functions too.</p>
  
  <p>Also the selectedClient() is a Client object received via WebApi so should match perfectly to PUT up again.</p>