I am not able to delete the list item using the `getitembyid(ID)` method using SP Online REST call. I am making a call to `deleteitem(murl)` where `murl` ===>

```
   for (var i = 0; i < data.d.results.length; 
       i++) 
        {  
         var item = data.d.results[i];  
             ID = item.ID;
       ID = item.ID
      var murl =  
  _spPageContextInfo.webAbsoluteUrl + 
 "/_api/web/lists/getByTitle('Posts_Testing')
   /getItemById("+ID+")";
.....
     }

```

Below is the code. What am I doing wrong?

```
  function deleteItem(murl) {
  alert(' inside delete fun');
    alert(murl);
    $.ajax({
   url: _spPageContextInfo.webAbsoluteUrl + 
   murl,
     type: "DELETE",
    headers: {
   "accept": 
   "application/json;odata=verbose",
  "X-RequestDigest": 
   $("#__REQUESTDIGEST").val(),
    "If-Match": "*"
       },
     success: function (data) {
     },
        error: function (error) {
       alert(JSON.stringify(error));
        }
     });
   }
          return true;
    }
</script>

```

I am getting error:

[![ErrorinRESTAPI-delete-call](https://i.stack.imgur.com/nKnww.png)](https://i.stack.imgur.com/nKnww.png)