title: How to do a Update/Merge/Patch to a SharePoint list with SharePoint_api
body: <p>I want to do a Update to a SharePoint list. I read the headers have to include <code>"X-HTTP-Method": "MERGE"</code> and the type should be <code>POST</code>. I dont know if <code>"IF-MATCH": "*"</code> is required to have a etag or not. When I delete an item the <code>"IF-MATCH": "*"</code> is not required to have a etag. Here is my code:</p>
  
  <pre><code>function UpdateBooking(ajaxData) {
    var url = `${_spPageContextInfo.webAbsoluteUrl}/_api/web/lists/getbytitle('Bokningar')/items`;
    //requestHeaders
    var requestHeaders = {
      "accept": "application/json;odata=verbose",
      "content-type": "application/json;odata=verbose",
      "X-HTTP-Method": "MERGE",
      "IF-MATCH": "*",
      "X-RequestDigest": jQuery('#__REQUESTDIGEST').val()
    }
  
    //Data
    var data = {
      __metadata: {
        "type": "SP.Data.BokningarListItem"
      },
      Title: ajaxData.Title,
      EventDate: ajaxData.EventDate,
      EndDate: ajaxData.EndDate,
      Description: ajaxData.Description,
      IsBlock: ajaxData.IsBlock,
      Milj_x00f6_: ajaxData.Milj_x00f6_,
      Program: ajaxData.Program
    };
  
    //requestBod
    var requestBody = JSON.stringify(data);
  
    //Post
    var post = jQuery.ajax({
      url: url,
      type: "POST",
      headers: requestHeaders,
      data: requestBody
    });
  
    //Done
    post.done(function(data, textStatus, jqXHR) {});
    //Fail
    post.fail(function(jqXHR, textStatus, errorThrown) {});
  }
  </code></pre>
  
  <p>This is the error I get:</p>
  
  <pre><code>{"error":{"code":"-1, Microsoft.SharePoint.Client.InvalidClientQueryException","message":{"lang":"en-US","value":"The type SP.ListItemEntityCollection does not support HTTP PATCH method."}}}
  </code></pre>
  
  <p>Any ideas what I am doing wrong?</p>