<form action="../de.pradip.jersey.todo/rest/todos" method="DELETE">
But it allows only creating new resources. I want to implement deletion of resources in same application.That's not correct, it does allow for deletion of resources. Check out point 9.3, the code for the class TodoResource contains a method towards the bottom called deleteTodo that accepts the DELETE method.
Skip point 9.5 because I am using html form to send request.If you will read again the previous comments that we both have made, you will see that we both said that submitting a delete request via HTML forms is not possible. You need to use ajax methods to do that as in the example given by shalomc.
<script>
function execute($method,$url){
xhr=new XMLHttpRequest();
xhr.onreadystatechange = function() {
if (xhr.readyState == 4) {
return(xhr.responseText);
}
}
xhr.open($method,$url,false)
xhr.send(null);
return(xhr.responseText);
}
execute('DELETE','http://localhost:8080/de.vogella.jersey.todo/rest/todos/1");
</script>
If you want further help, you will need to tell us more about what you are doing, such as what frameworks/libraries you are using on the client side (jQuery, etc) and what you are using on the server side (Spring, etc)? And any other detail that could be useful for us to help you out.